Microsoft KB Archive/939689

= 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 =

Article ID: 939689

Article Last Modified on 8/15/2007

-

APPLIES TO


 * Microsoft .NET Framework 1.1

-



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.



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 , 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
 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:// /uddi

Note If you are using a security-enhanced server, visit the following Web site:

https:// /uddi

 On the UDDI Services home page, click Publish. Under Publish, click tModels, and then click Add tModel. Under Actions, click Edit to change the name of the tModel. In the Name box, type, and then click Update. Click Categories tab under  , and then click Add Category. Under Categorizations, click uddi-org:types, and then click These types are used for tModels.</li> 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.</li> Under  , click the Overview Document tab.</li> On the Overview Document tab, click Edit.</li> In the Overview Document URL box, type the following URL, and then click Update:

http:// /Service1.asmx?WSDL

</li> 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.</li></ol>

Step 3: Publish the Web service in UDDI
<ol> On the UDDI Services home page, click Publish. The My UDDI page appears in the browser.</li> On the My UDDI page, click the Providers tab.</li> On the Providers tab, click Add Provider. The My UDDI (New Provider Name) page appears in the browser.</li> On the My UDDI (New Provider Name) page, click Edit under Actions.</li> In the Name box, type, and then click Update. The My UDDI (NewWebService) page appears in the browser.</li> On the My UDDI (NewWebService) page, click Services, and then click Add Service.</li> Under Actions, click Edit, type Service1 in the Name box, and then click Update.</li> On the &quot;My UDDI | NewWebService Service1&quot; page, click the Bindings tab.</li> On the Bindings tab, click Add Binding.</li> On the &quot;My UDDI | NewWebService Service1 http://&quot; page, click Edit.</li> In the Access Point box, type the following URL, and then click Update:

http:// /Service1.asmx

Note In the URL, replace  with the name of the server that hosts the Web service. Do not use &quot;http://localhost&quot; in the URL.</li> <li>On the UDDI Services page, click the Instance Info tab.</li> <li>On the Instance Info tab, click Add Instance Info.</li> <li>In the Search for tModel names containing box, type part of the tModel name, and then click Search.</li> <li>Click the  tModel for information about this instance of the new tModel.</li></ol>

Step 4: Reference the UDDI published Web service in a solution in Visual Studio
<ol> <li>Start Visual Studio 2005.</li> <li>Open any existing solution.</li> <li>In Solution Explorer, right-click the name of an existing project in the solution, and then click Add Web Reference.</li> <li>In the Add Web Reference dialog box, type the following URL in the URL box, and then click Go:

http:// /uddi/addwebreference

Note You can type % to view a list of all Web services.</li> <li>Under Web Services found at this URL, click to select Service1, and then click Add Reference.</li></ol>

Step 5: Add the UDDI published Web service to an InfoPath form
<ol> <li>Start InfoPath.</li> <li>On the File menu, click Design a Form.</li> <li>In the Design a Form dialog box, click New from Data Source under Design a new form. The Data Source Setup Wizard starts.</li> <li>In the Data Source Setup Wizard, click to select Web service, and then click Next.</li> <li>Click to select the Receive data option, and then click Next.</li> <li>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:// /uddi/inquire.asmx

Note You can type % to view a list of all Web services.</li> <li>In the Search Web Service dialog box, click to select Service1, and then click OK.</li> <li>In the Data Source dialog box, expand dataFields.</li> <li>Locate the &quot;Web Service method result&quot; field, and then drag the &quot;Web Service method result&quot; field to the form. Put the &quot;Web Service method result&quot; field in the Drag data fields here section of the form.</li> <li>Click Preview Form.</li> <li>Click Run Query to test the Web service.

The text &quot;Hello World&quot; appears in a box on the form.</li></ol>

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.

<div class="references_section">