Help and Support

Article ID: 939689 - Last Review: August 15, 2007 - Revision: 1.1

How to publish a Web service in Universal Description, Discovery and Integration (UDDI), and how to use the service in Visual Studio 2005 and in Office InfoPath

On This Page

Expand all | Collapse all

INTRODUCTION

This step-by-step article describes how to do the following:
  • Create an ASP.NET Web service by using Microsoft Visual Studio 2005 and the Microsoft .NET Framework 1.1
  • Publish the Web service in Universal Description, Discovery and Integration (UDDI)
  • Reference the Web service in a solution in Visual Studio
  • Add the Web service to a Microsoft Office InfoPath form
Note The UDDI service is not supported on a 64-bit operating system.

MORE INFORMATION

Step 1: Create a Web service

  1. Start Visual Studio 2005.
  2. On the File menu, click New, and then click Project.
  3. Under Project Types, click Visual C#.
  4. Under Templates, click ASP.NET Web Service Application.
  5. In the Name box, type myWebService, and then click OK.
  6. On the Build menu, click Build Solution.
  7. On the Debug menu, click Start Debugging.

    Note Make sure that you do not receive an error message and that the Service1.asmx page opens.

Step 2: Register the tModel in UDDI

  1. In a browser, visit the UDDI Services home page. UDDI Services is installed on Microsoft Windows Server 2003. To access UDDI Services, visit the following Web site:
    http://server_name/uddi
    Note If you are using a security-enhanced server, visit the following Web site:
    https://server_name/uddi
  2. On the UDDI Services home page, click Publish.
  3. Under Publish, click tModels, and then click Add tModel.
  4. Under Actions, click Edit to change the name of the tModel.
  5. In the Name box, type NewtModelName, and then click Update.
  6. Click Categories tab under NewtModelName, and then click Add Category.
  7. Under Categorizations, click uddi-org:types, and then click These types are used for tModels.
  8. Under Select a category or subcategory, click Specification for a web service. Click Specification for a web service described in WSDL, and then click Add Category.
  9. Under NewtModelName, click the Overview Document tab.
  10. On the Overview Document tab, click Edit.
  11. In the Overview Document URL box, type the following URL, and then click Update:
    http://ComputerName/Service1.asmx?WSDL
  12. On the Overview Document tab, click the URL that you added in step 11 to verify that the browser correctly displays the Web Service Description Language (WSDL) page.

Step 3: Publish the Web service in UDDI

  1. On the UDDI Services home page, click Publish. The My UDDI page appears in the browser.
  2. On the My UDDI page, click the Providers tab.
  3. On the Providers tab, click Add Provider. The My UDDI (New Provider Name) page appears in the browser.
  4. On the My UDDI (New Provider Name) page, click Edit under Actions.
  5. In the Name box, type NewWebService, and then click Update. The My UDDI (NewWebService) page appears in the browser.
  6. On the My UDDI (NewWebService) page, click Services, and then click Add Service.
  7. Under Actions, click Edit, type Service1 in the Name box, and then click Update.
  8. On the "My UDDI | NewWebService Service1" page, click the Bindings tab.
  9. On the Bindings tab, click Add Binding.
  10. On the "My UDDI | NewWebService Service1 http://" page, click Edit.
  11. In the Access Point box, type the following URL, and then click Update:
    http://computer_name/Service1.asmx
    Note In the URL, replace computer_name with the name of the server that hosts the Web service. Do not use "http://localhost" in the URL.
  12. On the UDDI Services page, click the Instance Info tab.
  13. On the Instance Info tab, click Add Instance Info.
  14. In the Search for tModel names containing box, type part of the tModel name, and then click Search.
  15. Click the NewtModelName tModel for information about this instance of the new tModel.

Step 4: Reference the UDDI published Web service in a solution in Visual Studio

  1. Start Visual Studio 2005.
  2. Open any existing solution.
  3. In Solution Explorer, right-click the name of an existing project in the solution, and then click Add Web Reference.
  4. In the Add Web Reference dialog box, type the following URL in the URL box, and then click Go:
    http://computer_name/uddi/addwebreference
    Note You can type % to view a list of all Web services.
  5. Under Web Services found at this URL, click to select Service1, and then click Add Reference.

Step 5: Add the UDDI published Web service to an InfoPath form

  1. Start InfoPath.
  2. On the File menu, click Design a Form.
  3. In the Design a Form dialog box, click New from Data Source under Design a new form. The Data Source Setup Wizard starts.
  4. In the Data Source Setup Wizard, click to select Web service, and then click Next.
  5. Click to select the Receive data option, and then click Next.
  6. In the Enter the location of the Web service you want to use as your data source box, type the following URL, and then click Search UDDI:
    http://computer_name/uddi/inquire.asmx
    Note You can type % to view a list of all Web services.
  7. In the Search Web Service dialog box, click to select Service1, and then click OK.
  8. In the Data Source dialog box, expand dataFields.
  9. Locate the "Web Service method result" field, and then drag the "Web Service method result" field to the form. Put the "Web Service method result" field in the Drag data fields here section of the form.
  10. Click Preview Form.
  11. Click Run Query to test the Web service.

    The text "Hello World" appears in a box on the form.
Typically, tModels are used to provide technical information about an interface. For example, the WSDL file describes the conventions that an interface supports. You can also use tModels to represent an organized unit of descriptive data such as an identification scheme or a categorization scheme. The way that you use tModels to implement Web services in your organization may vary depending on the organization's Web services publishing data model.

REFERENCES

For more information about how to use UDDI for Web service description and discovery, visit the following Microsoft Developer Network (MSDN) Web sites:
http://msdn2.microsoft.com/en-us/library/aa480517.aspx (http://msdn2.microsoft.com/en-us/library/aa480517.aspx)

http://msdn2.microsoft.com/en-us/library/aa480519.aspx (http://msdn2.microsoft.com/en-us/library/aa480519.aspx)

APPLIES TO
  • Microsoft .NET Framework 1.1
Keywords: 
kbhowto kbinfo KB939689

Article Translations

 

Related Support Centers