Domino 7/Visual Studio Web Services Integration: Hands on Labs

March, 2007
Gary Devendorf

Microsoft

............................................... 8 Web Services Hands on Labs Page 2 ............Contents Exercise 1 ................................................... 3 Exercise 2 Create a web service client for your web service......................Creating your first Domino 7 web service ...............

Launch Domino Designer. User Name is ³Jane Developer´ and Password is ³lotusnotes´ 2.Creating your first Domino 7 web service 1. Open the database Workshop (workshop. Expand the Shared Code database entry and click the ³New Web Service´ button Web Services Hands on Labs Page 3 .nsf) on the server Neutron/MSDomino 3.Exercise 1 .

Web Services Hands on Labs Page 4 .4. In the property box for the web service enter your name in the ³Name´ text box (we are all working on the same database so we need to name the web services something unique). Click on the security tab (the key) and select Allow Public Access users to use this web service. In the ³Port Type class´ text box enter hello 6. 5.

add the code: Class hello Function hello_name(FirstName As String) As String hello_name= "Hello " & FirstName & " this is from a Domino 7 web service" End Function End Class Web Services Hands on Labs Page 5 . In the Declarations section.7.

the URL looks like this: http://www.net/workshop.msdomino.msdomino. Save the web service. so your URL will look like: http://www.nsf>/<web service name>?WSDL.nsf/<Your Name>?wsdl In my case.net/workshop. The format for a Domino 7 WSDL URL is: <Server>/<database. 9.nsf/gary?wsdl Web Services Hands on Labs Page 6 .8. Open a browser and locate the WSDL file for your new web service.

Leave this browser window open.10. We will need the URL later. Web Services Hands on Labs Page 7 .

In the New Project Dialog.Exercise 2 Create a web service client for your web service 1. Select Project next to Create 3. 6. 5. 4. select Visual Basic as the Project type Pick Window Application as the Template Enter My web service client in the Name field Click OK Page 8 Web Services Hands on Labs . Start Visual Studio by clicking Start-Microsoft Visual Studio 2005-Microsoft Visual Studio 2005 2.

It should look something like this: Web Services Hands on Labs Page 9 . 8. Drag one button and two textboxes onto the form. 9.7. expand its size by dragging its lower right corner. When Form1 appears. Open the tool box.

Change the Text property value from Button1 to Call Web Service. You will need to stretch the button so all the text will show. 11.10. Web Services Hands on Labs Page 10 . Select Button1 and locate its Text Property in the Properties window.

Button1 now has the label Call Web Service. Before we add code. Web Services Hands on Labs Page 11 . we need to add a Web Reference for our Domino 7 web service.12. Right click on My web service client solution name to bring up a menu. 13. 14. Select Add Web Reference. Double click the Go button to see the code for the click event. We will be entering code in the Button1_Click Sub.

www Web Services Hands on Labs Page 12 .msdomino. Put the URL for your Domino 7 web service WSDL file in the ³URL´ text box and click ³Go´ 16. Notice the helloService with a Method called HELLO_NAME() 17. The default Web reference name is net.15.

These files were created from the WSDL content. Web Services Hands on Labs Page 13 . 19.18. Adding a Web Reference is not unlike installing a component. Feel free to look at the files by double clicking on them. Leave the default name and click the Add Reference button. Notice that a web reference is now added to the Solution Explorer. Our program can now use the Web Reference class and its Methods or Properties as you will see.

msdomino. In the Sub Button1_Click.www. Enter your name in Textbox1 and click the Call Web Service button. add this code.Text) 21.HELLO_NAME(TextBox1. 22.Text = MyDominoWS. 24.helloService TextBox2. Please type it to see the auto-complete functionality: Dim MyDominoWS As New net. Then click on the triangle to start the debugger. Notice any change in speed.20. Clear Textbox2 and click the button again. See the result in Textbox2. 23. Web Services Hands on Labs Page 14 .

net/orders.You have created a Domino 7 web service and a . create a client application for this WSDL file: www.NET windows client.nsf/order_update?wsdl You can find details at http://interoptips. Update your resume! For an advanced bonus exercise.msdomino.com/forums/thread/107.aspx Web Services Hands on Labs Page 15 .

Sign up to vote on this title
UsefulNot useful