{"id":77,"date":"2010-01-16T14:33:00","date_gmt":"2010-01-16T12:33:00","guid":{"rendered":"http:\/\/www.bestcoder.net\/?p=77"},"modified":"2012-10-14T13:52:21","modified_gmt":"2012-10-14T13:52:21","slug":"blackberry-application-development-part-1-domino-webservice","status":"publish","type":"post","link":"http:\/\/www.bestcoder.net\/?p=77","title":{"rendered":"Blackberry Application Development &ndash; Part 1 (Domino WebService)"},"content":{"rendered":"<p>Hello again,<\/p>\n<p>We are starting to develop blackberry mobile application. Our mobile application will be developed based on the domino webservice technology. So we are starting to develop our sample webservice.<\/p>\n<p>We will use following development IDE &amp; tools during our tutorial.<\/p>\n<ul>\n<li><span style=\"background-color: #ffffff;\"><a href=\"http:\/\/www-01.ibm.com\/software\/lotus\/notesanddomino\/\" target=\"_blank\">Lotus Domino Server 8.5<\/a><\/span><\/li>\n<li><span style=\"background-color: #ffffff;\"><a href=\"http:\/\/www-01.ibm.com\/software\/lotus\/notesanddomino\/\" target=\"_blank\">Lotus Notes &amp; Designer 8.5.1<\/a><\/span><\/li>\n<li><span style=\"background-color: #ffffff;\"><a href=\"http:\/\/na.blackberry.com\/eng\/developers\/javaappdev\/devtools.jsp\" target=\"_blank\">Eclipse 3.4.1 with Blackberry Plugin<\/a><\/span><\/li>\n<\/ul>\n<p>Now we will create lotus notes application to develop our webservice.<\/p>\n<ul>\n<li><span style=\"background-color: #ffffff;\">Title : Search People<\/span><\/li>\n<li><span style=\"background-color: #ffffff;\">DB File Name : searchpeople.nsf<\/span><\/li>\n<li><span style=\"background-color: #ffffff;\">Other settings : Default<\/span><\/li>\n<li>Add <strong><em>anonymous<\/em><\/strong> entry to ACL with <em><strong>Author &amp; Create Document<\/strong><\/em> property.<\/li>\n<\/ul>\n<p>Also you can create your database at any where in your server data directory. Webservice url seems like that : <span style=\"color: #000080;\">http:\/\/&lt;hostname&gt;\/&lt;nsf db file path&gt;\/&lt;web service name&gt;?wsdl<\/span><\/p>\n<p><a href=\"http:\/\/www.bestcoder.net\/wp-content\/uploads\/2010\/01\/SP01.CreateDB.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; margin-left: 0px; margin-right: 0px; border-width: 0px;\" title=\"SP - 01. Create DB\" src=\"http:\/\/www.bestcoder.net\/wp-content\/uploads\/2010\/01\/SP01.CreateDB_thumb.jpg\" alt=\"SP - 01. Create DB\" width=\"218\" height=\"244\" border=\"0\" \/><\/a><\/p>\n<p><em>01. Create Database<\/em><\/p>\n<p><!--more--><\/p>\n<p>Create webservice design element.<\/p>\n<ul>\n<li>\n<div><span style=\"background-color: #ffffff;\">Open your database at designer<\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"background-color: #ffffff;\">Expand <strong>Code \\ Web Service Providers<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"background-color: #ffffff;\">Click to <strong>New Web Service Provider<\/strong> button.<\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"background-color: #ffffff;\">Name : <strong>SearchPeople<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"background-color: #ffffff;\">Type : <strong>LotusScript<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"background-color: #ffffff;\">Click to OK.<\/span><\/div>\n<\/li>\n<\/ul>\n<p><a href=\"http:\/\/www.bestcoder.net\/wp-content\/uploads\/2010\/01\/SP05.PreviewWebService.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"SP - 05. Preview WebService\" src=\"http:\/\/www.bestcoder.net\/wp-content\/uploads\/2010\/01\/SP05.PreviewWebService_thumb.jpg\" alt=\"SP - 05. Preview WebService\" width=\"417\" height=\"269\" border=\"0\" \/><\/a><\/p>\n<p>02. Domino Designer IDE<\/p>\n<p><a href=\"http:\/\/www.bestcoder.net\/wp-content\/uploads\/2010\/01\/SP02.CreateWebServiceProvider.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"SP - 02. Create Web Service Provider\" src=\"http:\/\/www.bestcoder.net\/wp-content\/uploads\/2010\/01\/SP02.CreateWebServiceProvider_thumb.jpg\" alt=\"SP - 02. Create Web Service Provider\" width=\"244\" height=\"150\" border=\"0\" \/><\/a><\/p>\n<p><em>03. Webservice (SearchPeople)<\/em><\/p>\n<table width=\"510\" border=\"1\" cellspacing=\"2\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"251\"><a href=\"http:\/\/www.bestcoder.net\/wp-content\/uploads\/2010\/01\/SP03.WebServiceSettings1.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; margin-left: 0px; margin-right: 0px; border-width: 0px;\" title=\"SP - 03. Web Service Settings 1\" src=\"http:\/\/www.bestcoder.net\/wp-content\/uploads\/2010\/01\/SP03.WebServiceSettings1_thumb.jpg\" alt=\"SP - 03. Web Service Settings 1\" width=\"244\" height=\"173\" align=\"left\" border=\"0\" \/><\/a><\/td>\n<td valign=\"top\" width=\"251\"><a href=\"http:\/\/www.bestcoder.net\/wp-content\/uploads\/2010\/01\/SP04.WebServiceSettings2.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; margin-left: 0px; margin-right: 0px; border-width: 0px;\" title=\"SP - 04. Web Service Settings 2\" src=\"http:\/\/www.bestcoder.net\/wp-content\/uploads\/2010\/01\/SP04.WebServiceSettings2_thumb.jpg\" alt=\"SP - 04. Web Service Settings 2\" width=\"244\" height=\"186\" align=\"left\" border=\"0\" \/><\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><em>04. Web Service Properties<\/em><\/p>\n<p>Web Service Properties (<span style=\"font-size: xx-small;\"><em>03. Webservice &#8211; Basics Tab<\/em> &amp; <em>04. Web Service &#8211; Advance Tab<\/em><\/span>)<\/p>\n<ul>\n<li>\n<div><span style=\"background-color: #ffffff;\">Tab : Basics<\/span><\/div>\n<ul>\n<li>\n<div><span style=\"background-color: #ffffff;\">Name : <strong>SearchPeople<\/strong><\/span><\/div>\n<\/li>\n<li><span style=\"background-color: #ffffff;\">PortType Class : <strong>SearchPeople<\/strong><\/span><\/li>\n<\/ul>\n<\/li>\n<li>\n<div>Tab : Advcance<\/div>\n<ul>\n<li>\n<div>Options \\ Programming model : <strong>RPC<\/strong><\/div>\n<\/li>\n<li>\n<div>SOAP Message Format :<strong>Doc\/literal<\/strong><\/div>\n<\/li>\n<li>\n<div>Include operation name in SOAP action : <strong>Checked<\/strong><\/div>\n<\/li>\n<li>\n<div>Port type name : <strong>SearchPeople<\/strong><\/div>\n<\/li>\n<li>\n<div>Service element name : <strong>SearchPeopleService<\/strong><\/div>\n<\/li>\n<li>\n<div>Service port name : <strong>Domino<\/strong><\/div>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>Add following codes to the Declarations event of webservice.<\/p>\n<pre class=\"lang:default decode:true\">%REM\r\n############################################################\r\nWEB SERVICES : SearchPeople\r\nDEVELOPER : Ferhat BULUT\r\nWEB SITE : www.bestcoder.net\r\nE-MAIL : ferhat@bestcoder.net\r\nCREATED DATE : JANUARY 13, 2010\r\nMODIFIED DATE : -\r\n\r\nCOMMENTS\r\nBu WebService BestCoder.NET sitesinde yay\u0131nlanmak \u00fczere blackberry mobil uygulama geli\u015ftirme \u00f6rne\u011fi i\u00e7in\r\nhaz\u0131rlanm\u0131\u015ft\u0131r.\r\n\r\nSIGNATURE\r\n..:: Dream It, Code It ::..\r\n############################################################\r\n%END REM\r\n\r\nREM Declaration of global variables accessible from all parts of the Web service.\r\nClass Person\r\n\r\nPublic NameSurname As String\r\nPublic NoteID As String\r\n\r\nEnd Class\r\n\r\nClass PersonList\r\n\r\nPublic Persons () As Person\r\n\r\nEnd Class\r\n\r\nClass SearchPeople\r\n\r\nPublic Function Search ( Key As String ) As PersonList\r\n\r\nOn Error Goto ErrorHandler\r\n\r\nDim oSession As New NotesSession\r\nDim oDatabase As NotesDatabase\r\n\r\nDim i As Integer\r\nDim strSearchString As String\r\n\r\nSet Search = New PersonList\r\n\r\nREM Debug\r\nPrint \"WebService : SearchPeople - Function : Search - Start\"\r\n\r\nREM Get Current Database\r\nSet oDatabase = oSession.CurrentDatabase\r\n\r\nDim oNamesDB As NotesDatabase\r\nDim oPersonCollection As NotesDocumentCollection\r\nDim oPersonDoc As NotesDocument\r\nDim oNNPerson As NotesName\r\n\r\nREM Get Domino Directory Database\r\nSet oNamesDB = oSession.GetDatabase ( oDatabase.Server, \"names.nsf\", False )\r\n\r\nREM Create FT Search String\r\nstrSearchString = {[FORM] CONTAINS \"Person\" AND [FULLNAME] CONTAINS \"} + Key + {\"}\r\nSet oPersonCollection = oNamesDB.FTSearch( strSearchString, 10, FT_SCORES, FT_FUZZY )\r\n\r\nREM If collection is empty go to exit\r\nIf oPersonCollection.Count = 0 Then\r\n\r\nRedim Search.Persons ( 0 )\r\n\r\nSearch.Persons ( 0 ).NameSurname = \"\"\r\nSearch.Persons ( 0 ).NoteID = \"\"\r\n\r\nGosub Finish\r\n\r\nEnd If\r\n\r\nREM resize person array with the size of collection\r\nRedim Search.Persons ( oPersonCollection.Count - 1 )\r\n\r\ni = 0\r\n\r\nSet oPersonDoc = oPersonCollection.GetFirstDocument\r\n\r\nDo While Not ( oPersonDoc Is Nothing )\r\n\r\nREM Create person class in person array\r\nSet Search.Persons ( i ) = New Person\r\n\r\nSet oNNPerson = New NotesName ( oPersonDoc.FullName ( 0 ) )\r\n\r\nSearch.Persons ( i ).NameSurname = oNNPerson.Abbreviated\r\nSearch.Persons ( i ).NoteID = Cstr ( oPersonDoc.NoteID )\r\n\r\nSet oPersonDoc = oPersonCollection.GetNextDocument ( oPersonDoc )\r\n\r\ni = i + 1\r\n\r\nLoop\r\n\r\nFinish:\r\n\r\nREM Debug\r\nPrint \"WebService : SearchPeople - Function : Search - End\"\r\n\r\nExit Function\r\n\r\nErrorHandler:\r\n\r\nREM Debug\r\nPrint \"WebService : SearchPeople - Function : Search - Error Description : \" + Error$ + \" - Error Line Number : \" + Cstr ( Erl )\r\n\r\nEnd\r\n\r\nEnd Function\r\n\r\nEnd Class<\/pre>\n<p>Save and close. Our webservice is ready.<\/p>\n<p>But donot forget to configure your domino server settings :<\/p>\n<ul>\n<li><span style=\"background-color: #ffffff;\"><em>Check <strong>Http<\/strong><\/em> task is running<\/span><\/li>\n<li><span style=\"background-color: #ffffff;\">Add Signer of webservice to <span style=\"color: #0000ff;\">Security \\ Programmability\u00a0 Restrictions \\ Sign or run unrestricted methods and operations<\/span> field.<\/span><\/li>\n<li><span style=\"background-color: #ffffff;\"><span style=\"color: #0000ff;\"><em>Internet Protocols \\ Domino Web Engine \\ Web Agents and Web Services \\ Run web agents and web services concurrently?<\/em><\/span> value must be <strong>Enabled<\/strong><\/span><\/li>\n<li><span style=\"background-color: #ffffff;\">Give an integer value to <em><span style=\"color: #0000ff;\">Internet Protocols \\ Domino Web Engine \\ Web Agents and Web Services \\ <\/span><\/em><\/span><em><span style=\"color: #0000ff;\">Web agent and web services timeout<\/span><\/em> field. Maybe 60 seconds<\/li>\n<\/ul>\n<p>Lets check our webservice is OK ?<\/p>\n<p>Open your browser.<\/p>\n<p>Write to address field. <span style=\"color: #000080;\">http:\/\/&lt;local computer ip or host name&gt;\/&lt;Db file path&gt;\/PeopleSearch?wsdl<\/span> and hit to Enter. You will see following picture in your browser.<\/p>\n<p><a href=\"http:\/\/www.bestcoder.net\/wp-content\/uploads\/2010\/01\/SP06.WebServicePreviewinBrowser.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;\" title=\"SP - 06. WebService Preview in Browser\" src=\"http:\/\/www.bestcoder.net\/wp-content\/uploads\/2010\/01\/SP06.WebServicePreviewinBrowser_thumb.jpg\" alt=\"SP - 06. WebService Preview in Browser\" width=\"359\" height=\"248\" border=\"0\" \/><\/a><\/p>\n<p>OK. Web will develop client side of our tutorial at Part 2. We will use Eclipse with Blackberry Plugin IDE. See you next time.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello again, We are starting to develop blackberry mobile application. Our mobile application will be developed based on the domino webservice technology. So we are starting to develop our sample webservice. We will use following development IDE &amp; tools during our tutorial. Lotus Domino Server 8.5 Lotus Notes &amp; Designer 8.5.1 Eclipse 3.4.1 with Blackberry &hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,3],"tags":[85,9,7],"class_list":["post-77","post","type-post","status-publish","format-standard","hentry","category-blackberry","category-lotusnotesdevelopment","tag-blackberry","tag-lotus","tag-webservice","entry","has-more-link"],"_links":{"self":[{"href":"http:\/\/www.bestcoder.net\/index.php?rest_route=\/wp\/v2\/posts\/77","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.bestcoder.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.bestcoder.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.bestcoder.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.bestcoder.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=77"}],"version-history":[{"count":16,"href":"http:\/\/www.bestcoder.net\/index.php?rest_route=\/wp\/v2\/posts\/77\/revisions"}],"predecessor-version":[{"id":80,"href":"http:\/\/www.bestcoder.net\/index.php?rest_route=\/wp\/v2\/posts\/77\/revisions\/80"}],"wp:attachment":[{"href":"http:\/\/www.bestcoder.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=77"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.bestcoder.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=77"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.bestcoder.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=77"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}