UDDI: The Registry

Team Fly 

Page 336

The binding element describes the protocol, any serialization, and encoding for the message transmission.

The service element concludes a WSDL description, and it provides yet another listing of the final destination of the client message. A message can move to multiple locations on its trip to the service, but in the service element is the actual, final address where the Web service itself is located. However, WSDL descriptions can contain multiple Web services—so consumers are thus able to select between options (preferring, say, a Web service that returns its response in pounds rather than dollars).

 <service name=''Service1">   <documentation>Adds or Multiplies to Integers</documentation> <port name="Service1Soap" binding="s0:Service1Soap"> <soap:address location="http://localhost/xx/Service1.asmx" />   </port>   </service> 

Seeing SOAP, WSDL, and the Reference Map

You don't have to generate the dependency SOAP, WSDL, and Reference Map files—VB.NET does this for you when you create a Web service, then add the service to a project. Nonetheless, you should take a look at them to see the information they contain. In particular, there's a Reference.vb file that contains information you need to know to consume a Web service (the parameters it expects, and what it returns), written in familiar VB.NET code.

Use Project image Add Web Reference to add a Web service to your current project; for this example I'll use the ShowJobs service created previously in this chapter.

Now slowly move your mouse pointer across the icons in Solution Explorer's title bar to locate the one labeled Show All Files. Possibly the icons are not visible, which means you're in a mode in the IDE that the designers thought wasn't a context in which you'd want to see the icons (this kind of thing seems a little too helpful to me; what harm is done by leaving these icons always visible?). To make them visible, click the name of your project (it's the line in boldface) in Solution Explorer.

Now expand the Web service node (Web References\Localhost). Take a look at the Disco (discovery) file, then also double-click the WSDL file to see what it looks like for this service. Disco is Microsoft's alternative to UDDI (or their supplement, you might say). Disco is supposed to be an easier way to figure out which Web services are available on a particular server. Where UDDI is an Internet-wide registry, Disco does the same job for smaller, intranet services.

The Reference.vb file in Solution Explorer can be the most useful to programmers trying to figure out how to access a Web service (unless the service's own documentation is clear). In particular, this VB code makes it pretty clear that no parameter is expected, and that a dataset will be returned from this Web service:

 Public Function ShowJobs() As System.Data.DataSet 

UDDI: The Registry

Web services employ SOAP, WSDL, and UDDI. SOAP explains how to use the service (and possibly additional documentation). WSDL describes the entire transaction between client and service.

Team Fly 


Visual Basic  .NET Power Tools
Visual Basic .NET Power Tools
ISBN: 0782142427
EAN: 2147483647
Year: 2003
Pages: 178

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net