TEAM FLY PRESENTS in VS .NET

Paint EAN-13 in VS .NET TEAM FLY PRESENTS
TEAM FLY PRESENTS
Generating GTIN - 13 In VS .NET
Using Barcode maker for Visual Studio .NET Control to generate, create EAN13 image in Visual Studio .NET applications.
Figure 4-2 A client-side SOAP stack can use a WSDL document at run time to formulate the Web service request message and understand the response message
EAN-13 Supplement 5 Scanner In .NET
Using Barcode scanner for .NET framework Control to read, scan read, scan image in Visual Studio .NET applications.
WSDL Overview
Bar Code Generation In .NET Framework
Using Barcode creator for Visual Studio .NET Control to generate, create barcode image in Visual Studio .NET applications.
Figure 4-3 shows a client invoking a Web service using SOAP and another client invoking the same service using HTTP GET Figure 4-4 shows the same process with the various pieces labeled with WSDL terminology
Bar Code Recognizer In Visual Studio .NET
Using Barcode scanner for .NET Control to read, scan read, scan image in VS .NET applications.
Figure 4-3 Two clients invoking a Web service Client A is using SOAP over HTTP while client B is using HTTP GET
UPC - 13 Encoder In Visual Studio .NET
Using Barcode creation for ASP.NET Control to generate, create EAN-13 image in ASP.NET applications.
TEAM FLY PRESENTS
Painting Bar Code In .NET
Using Barcode creation for Visual Studio .NET Control to generate, create bar code image in .NET framework applications.
Figure 4-4 WSDL terminology labeling the various parts of a client-service interaction
Creating Bar Code In Visual Studio .NET
Using Barcode encoder for VS .NET Control to generate, create barcode image in VS .NET applications.
In WSDL, a service exposes groups of operations (ie methods) Each group of operations is called a portType which is roughly analogous to an interface in the COM world To invoke an operation, the client sends an input message and gets back an output message The input message contains the data going to the service and the output message contains the data coming back from the service Each item of data in a message is called a message part or simply part The actual protocol used to invoke an operation and the actual format of the input and output messages are specified in a binding The service itself is exposed to the world via one or more ports Each port specifies two things: A network address where it s located (eg http://wwwlearnXmlwscom/services/WeatherRetrieverasmx ) and the binding to use with this port A service may be exposed via multiple ports each with a different binding For example, the service in Figure 4-4 is exposed via two ports: One with a binding for SOAP and the other with a binding for HTTP GET Figure 4-5 shows the components of a WSDL document and how they relate to each other The boxes show the containment relations and the arrows show the reference relations
Make ECC200 In .NET
Using Barcode creator for .NET framework Control to generate, create DataMatrix image in .NET applications.
TEAM FLY PRESENTS
EAN / UCC - 13 Encoder In .NET
Using Barcode maker for Visual Studio .NET Control to generate, create EAN / UCC - 14 image in VS .NET applications.
Figure 4-5 The components of a WSDL document and how they relate to one another
Make NW-7 In .NET
Using Barcode printer for .NET framework Control to generate, create ABC Codabar image in .NET applications.
A service contains one or more ports and each port references a binding Each binding references a portType, the operations within that portType and the messages that make up each operation Each portType contains zero or more operations Each operation has an input and output message (I ll discuss other message combinations later in this chapter) Each message has zero or more parts and each part is of some data type The part s type could be an XSD built-in type such as xsd:int or it could be a custom simple or complex type that s defined using XSD
Creating Code 128 Code Set B In Java
Using Barcode creation for Java Control to generate, create ANSI/AIM Code 128 image in Java applications.
A WSDL Example
Paint Bar Code In .NET
Using Barcode drawer for ASP.NET Control to generate, create bar code image in ASP.NET applications.
Let s take a look at a simple example Web service and the corresponding WSDL document I created a VB 6 COM component called VB6Weather with one method:
Generating Data Matrix ECC200 In VB.NET
Using Barcode generator for Visual Studio .NET Control to generate, create Data Matrix ECC200 image in .NET framework applications.
Public Function GetTemperature(ByVal zipcode As String, _ ByVal celsius As Boolean) As Single 'code omitted
GS1 - 13 Creation In Java
Using Barcode creation for Java Control to generate, create EAN 13 image in Java applications.
End Function
ANSI/AIM Code 128 Printer In VS .NET
Using Barcode printer for ASP.NET Control to generate, create Code 128 Code Set A image in ASP.NET applications.
Then I ran the SOAP Toolkit s WSDL Generator to create the corresponding WSDL which is shown in Listing 4-1
Creating Code 128A In VB.NET
Using Barcode maker for .NET Control to generate, create Code128 image in .NET applications.
TEAM FLY PRESENTS
EAN-13 Supplement 5 Drawer In Visual Studio .NET
Using Barcode creation for ASP.NET Control to generate, create GS1 - 13 image in ASP.NET applications.
Listing 4-1 A WSDL document created by the SOAP Toolkit s WSDL Generator (VBWSBook\4 \ExampleWSDLs\VB6Weatherwsdl)
Creating Data Matrix ECC200 In Visual C#.NET
Using Barcode generation for .NET Control to generate, create Data Matrix ECC200 image in VS .NET applications.
< xml version='10' encoding='UTF-8' > <!-- Generated 08/16/01 by Microsoft SOAP Toolkit WSDL File Generator, Version 1028130 --> <definitions name ='VB6Weather' targetNamespace = 'http://tempuriorg/wsdl/' xmlns:wsdlns='http://tempuriorg/wsdl/' xmlns:typens='http://tempuriorg/type' xmlns:soap='http://schemasxmlsoaporg/wsdl/soap/' xmlns:xsd='http://wwww3org/2001/XMLSchema' xmlns:stk='http://schemasmicrosoftcom/soap-toolkit/wsdl-extension' xmlns='http://schemasxmlsoaporg/wsdl/'> <types> <schema targetNamespace='http://tempuriorg/type' xmlns='http://wwww3org/2001/XMLSchema' xmlns:SOAP-ENC='http://schemasxmlsoaporg/soap/encoding/' xmlns:wsdl='http://schemasxmlsoaporg/wsdl/' elementFormDefault='qualified'> </schema> </types> <message name='VB6WeatherGetTemperature'> <part name='zipcode' type='xsd:string'/> <part name='celsius' type='xsd:boolean'/> </message> <message name='VB6WeatherGetTemperatureResponse'> <part name='Result' type='xsd:float'/> </message> <portType name='VB6WeatherSoapPort'>
Drawing Universal Product Code Version A In Java
Using Barcode generation for Java Control to generate, create GS1 - 12 image in Java applications.
TEAM FLY PRESENTS
Encoding Bar Code In VS .NET
Using Barcode maker for ASP.NET Control to generate, create bar code image in ASP.NET applications.
<operation name='GetTemperature' parameterOrder='zipcode celsius'> <input message='wsdlns:VB6WeatherGetTemperature' /> <output message='wsdlns:VB6WeatherGetTemperatureResponse' /> </operation> </portType> <binding name='VB6WeatherSoapBinding' type='wsdlns:VB6WeatherSoapPort' > <stk:binding preferredEncoding='UTF-8'/> <soap:binding style='rpc' transport='http://schemasxmlsoaporg/soap/http' /> <operation name='GetTemperature' > <soap:operation soapAction='http://tempuriorg/action/VB6WeatherGetTemperature ' /> <input> <soap:body use='encoded' namespace='http://tempuriorg/message/' encodingStyle='http://schemasxmlsoaporg/soap/encoding/' /> </input> <output> <soap:body use='encoded' namespace='http://tempuriorg/message/' encodingStyle='http://schemasxmlsoaporg/soap/encoding/' /> </output> </operation> </binding> <service name='VB6Weather' > <port name='VB6WeatherSoapPort' binding='wsdlns:VB6WeatherSoapBinding' > <soap:address location='http://localhost/webtest/vb6weather/VB6WeatherASP' />
TEAM FLY PRESENTS
</port> </service> </definitions>
In chapter 3 you learned that there are four styles of SOAP messages which are RPC/encoded, RPC/literal, document/encoded, and document/literal RPC/encoded is the default for exposing Web services using the Microsoft SOAP Toolkit, therefore the corresponding WSDL in Listing 4-1 is for RPC/encoded messages In the next section, I ll explain how the WSDL would differ for the other three styles of messages Looking at the document in Listing 4-1, you see that the default namespace is declared as http://schemasxmlsoaporg/wsdl/ which is the WSDL namespace The document starts with the <definitions> element which is the document element (the topmost element) of a WSDL document and usually contains a few namespace declarations like you see here The <definitions> element has an optional attribute called targetNamespace which defines the containing namespace for all WSDL items defined in this document such as messages, operations, and portTypes The WSDL targetNamespace attribute is functionally similar to the XSD targetNamespace attribute discussed in 2 The next element down is the <types> element which contains an XSD schema This schema is where you d define custom types to use with message parts such as TypeA and TypeB in Figure 4-5 In this particular example there are no custom types because all the parameters and return value of the GetTemperature method can be represented using XSD built-in types Next comes the definition of messages using the <message> element Each message has a unique name indicated by its name attribute There are two messages: one represents the request and one represents the response In this case, the SOAP Toolkit uses the names VB6WeatherGetTemperature and VB6WeatherGetTemperatureResponse following its ComponentMethod and ComponentMethodResponse naming convention Note that this is just the naming convention that the SOAP Toolkit follows, there is no standard way to name the messages, you can name them anything you like The request message contains two parts correponding to the two parameters, zipcode and celsius, of the GetTemperature method When using SOAP RPC, these part names must match the method parameter names because that s a rule of SOAP RPC as discussed in chapter 3 Each part type is the XSD-equivalent of the VB parameter type For example, A VB Boolean becomes an xsd:boolean and a VB Single becomes an xsd:float Appendix A shows the SOAP Toolkit s mapping between XSD types and VB types The response message contains one part which corresponds to the method return value If there were any ByRef parameters (ie in/out parameters), you would see the corresponding parts in both the request and response messages If a Web service method has out parameters, they would be represented here as parts inside the response message Although you cannot create methods with out parameters in Visual Basic, other languages such as C# allow you to do that, so you might encounter Web services that have out parameters The <portType> element defines the collection of methods exposed by the Web service so you can think of it as an interface implemented by the Web service Each portType must have a unique name, which in this example is VB6WeatherSoapPort, but that name can be anything you like Inside the <portType>, an <operation> element represents each method and contains a reference to the input (request) and output (response) messages using <input> and <output> element An important thing to note here is that when referring to a message, you must use its fully qualified name This is because a message belongs to the targetNamespace as defined in the <definitions> element Looking back at the <definitions> element in Listing 4-1, you ll notice that the targetNamespace is defined as http://tempuriorg/wsdl/ and that the prefix wsdlns also maps to the same namespace Therefore when you want to refer to the message called VB6WeatherGetTemperature, you have to prefix the message name with the targetNamespace prefix which is wsdlns in this example This is exactly the same mechanism that XSD uses for specifying the targetNamespace of custom types then referring to those types later within your schema (see chapter 2) The <operation> element itself has the optional attribute parameterOrder which lists all method parameters in the order in which they appear in the method declaration This attribute is optional, but you ll usually see it in WSDL documents for Web services that use RPC-style SOAP (rather than documentstyle) At this point, you might be wondering how does a development tool (eg wsdlexe) figure out whether each <part> is in, in/out, out, or the return value The rules for determining this depend on the parameterOrder attribute as follows: for each parameter that appears in the parameterOrder list, if