SOAP Over HTTP

While SOAP can be used over a variety of transports, HTTP is the most commonly used because of its ubiquity. HTTP requests are very easy to form, they consist of simply an HTTP command such as POST or GET followed by the URL you're requesting and the protocol version e.g. HTTP 1.0. An HTTP request or response usually contains HTTP headers which are sim ple information organized in name-value pairs. For example, this is an HTTP GET request for the resource images pp_header_02.jpg with the two...

Communicating Error Information

Going back to the invoice messaging application, I added a simple procedure called SendFault to invoiceMessaging.asp. I also changed the error handling code in invoiceMessaging.asp to invoke this new procedure with the right parameters and end the response. Listing 3-13 shows this procedure along with two examples of calling it. Listing 3-11 Communicating error information using < soapenv Fault> and custom < detail> child elements 'To indicate the schema document could not be loaded...

Schemas and XML Serialization

To show you how XSD and XML serialization are used in Web services, I put together an example vendor application that sends electronic invoices to a buyer a pplication. The scenario is as follows The buyer and seller establish a schema for the invoice document (shown in listing 2-11). This schema will serve as the basis for the electronic document exchange that will take place between the two parties. Listing 2-2-11 Invoice XML schema. This schema is use d to validate invoice documents received...

Interop Efforts

Specification, however, the tools being tested may not be WSDL aware. Both round 1 and 2 tests focus on SOAP interop not WSDL. 3. Builders of SOAP implementations create Web services (using their SOAP implementations) that implement the test specifications. For example, the SOAP Toolkit's implementation of round 2 tests is at 4. Builders of SOAP implementations create clients (using their SOAP implementations) that invoke other Web services implementing t he test suite. Invocation results...

The XSD Type System

In this section, Ml explain the essential concepts of the XSD type system to prepare you for creating your own schemas. XSD s type system is made u p of simple and complex types. Simple types represent non-structured or scalar values. For example, int, date, and string are all simple types. Complex types represent structured data as you saw earlier in the Customer class example. A VB class or UDT (structure), can be represented as an elem ent that contains child elements or attributes. Such an...

LogOnLog Off and Permissions Checking

A class called SessionMgr is used to handle all database activities. This class exposes methods named LogOn and LogOff which handle creating and removin g records from the Sessions table. LogOn checks the supplied user id and password against the Users table and calls CreateSession if the credentials are correct. LogOff simply deletes the session record. List ing 10-4 shows the implementation of LogOn, LogOff and CreateSession. Listing 10-4 Authentication functions of the SessionMg r class...

The Client

On Error GoTo eh vbws.ServiceUrl SERVICE_URL vbws.SoapAction vbws.WriteBodyXml doc.documentElement.xml vbws.send If Not doc.loadXML(vbws.GetResponseString) Then MsgBox Error loading response document & vbCrLf & _ doc.parseError.reason & vbCrLf & Response doc ument is & vbCrLf & vbws.GetResponseString(), vbCritical Exit Sub Else MsgBox Response is & vbws.GetResponseString End If MsgBox Error sending invoice document & vbCrLf & Err.Description End Sub To send the...

Using High Level API From Classic ASP

To invoke Web services from a classic ASP page, you use the SoapClient30 object much like a VB client would. There's only one extra step you need to be aware of If you use HTTP to load the WSDL file, you must set the ServerHTTPRequest client property to True. Listing 5-6 shows an example ASP page that calls a Web service using the high-level API. Listing 5-6 An example ASP page inoking a Web service with the SOAP toolkit. (VBWSBook Chapter5 weather.asp) Dim soap Set soap soap.MSSoapInit _ <...

Real World Example

To show you a real-world example that applies the key data structures explained above, I extracted the businessService structure for a Web service named Ga lapagos. This service is a commercial Web service that provides financial information such as real time and delayed stock quotes 5 . Listing 11-5 shows the entire businessService structure which contains four bindingTemplates. Listing 11-5 A real-world example of a commercial Web service registered with UDDI. < -- The service itself -->...

Overriding Serialization Attributes

Assume the seller now wants to send electronic invoices to another buyer. This buyer agrees to the invoice schema except for invoiceNumber They insist that invoiceNumber must be an attribute of the < invoice> element. To satisfy this requirement, the seller continues to use the SellerInvoice class but applies a serialization override while serializing invoices. Serialization overrides let you specify at run time how an object is to be serialized. They are applied to an object externally so...

Communicating Errors

SOAP provides a standard mechanism for reporting error information using the < soap Fault> element which was discussed in Chapter 3. When using .NET, any exceptions not caught in the Web method get reported to the client as a < soap Fault> . Similarly, .NET clients throw a SoapException whenever they receive a < soap Fault> . In the simplest case, you can communic ate errors from a service by throwing an exception, for example Throw New Exception(This is the error information ) For...

Defining SOAP Headers

After defining your header classes, you need to specify which Web methods will use these headers. You first declare public member variables of the types of headers you want to use. For example, listing 7-2 shows a Web service with two member variables one of type HeaderClass1 and one of type HeaderClass2. Note that the member variables must be public. Listing 7-2 A Web service with two member variables representing two SOAP headers. (VBWSBook Chapter7 DataService.asmx.vb). Inherits...

Using NET

The .NET platform provides built-in support for building and consuming standards-based Web services. Unlike other development platforms, you do not need additional tools or SDKs to build Web services with .NET. All the necessary support is built into the . NET Framework itself including the server-side request handlers and the client side support for sending and receiving SOAP messages. This section gives you an overview of the steps to build and use a Web service with .NET. More details will...

Invoking Services with the Low Level API

In addition to SoapReader30 and SoapSerializer30, clients using the low level API use an HttpConnector30 to send the HTTP request and receive the response. Figure 5-14 shows the toolkit's low level API classes that a client application uses. To see how these classes are used, let's examine a client that uses the low level API to invoke the server in listing 5-19. Listing 5- 20 shows a simple client that does just that. Note You do not have to use the low level API to invo ke a service that uses...

Starting with a Relational Database

GetCustomersDataSet uses GetData to create a new D ataSet and fill it with a list of customer ids and company names from the Customers table. It then ret urns this DataSet to the client. Remember, it just looks like you're returning a DataSet what's really returned is XML. Listing 9-2 shows an example request message and the corresponding response message with the DataSet. It should be very clear from listing 9- 2 that all the client receives is XML. Listing 9-2 Example request and response...

Data Sets from Schemas

Starting with a schema you have the option to create the DataSet structure at runtime or at design time. To create the DataSet structure at runtime, you instantiate a DataSet and tell it to read an XML schema causing it to create tables, columns, constraints, and relations based on the schema. You can then fill this DataSet with data from a relational database or from an XML document. The role of the schema here is just to tell the DataSet about the table structure. Consider for example the...

Implementing an Interface

Whether you define the interfaces yourself or work with interfaces that someone else defined, you'll eventually want to implement those interfaces. Although you could read the WSDL document and write all the corresponding VB code from scratch including the WebServiceBinding attribute, something tells me you're not going to want to do that. Instead, you can use wsdl.exe with the server switch to tell it you want to create a service that implements the specifie d interface. wsdl.exe takes the...

Generic Type Mapper

The generic type mapper handles serialization to from application objects. It serializes object properties to XML elements and deserializes XML elements back i nto object properties. Consider a server COM component with the GetStoreSales method shown in listing 5-7. Listing 5-7 A GetSoreSales method that returns a Store object. VBWSBook Chapter5 ComplexTypeServer Stores.cls Public Function GetStoreSales ByVal user As String, ByVal password As String, _ ByVal Storeld As String As Store If user...

Bad WSDL No Problem

When interoperating with non .NET Web services, it's common to run into Web services that have no WSDL or whose WSDL cannot be read by VS .NET or wsdl.exe. When this happens, you have to write the proxy code yourself. As an example of this scenario, we'll c all a Web service that returns sunrise sunset times given longitude latitude and a date. The Web service's WSDL document was originally located at IAstro but has since been taken offline. There's a copy of this WSDL in this chapter's client...

Handling XML Documents

lt soap Envelope gt lt soap Body gt lt CustomerData lt Customers CustomerID ALFKI CompanyName Alfreds Futterkiste gt lt Customers CustomerID WOLZA CompanyName Wolski Zajazd gt lt CustomerData gt lt soap Body gt lt soap Envelope gt There are several steps you have to take on the server side to return an XML document as in listing 9-15. First you have to add the right attributes to your Web method to make sure your XML document gets serialized directly inside lt soap Body gt with no wrapper...

Web Service Request Processing

and call its GetHandler method which returns an HttpHandler object, i.e. an object that implemenents IHttpHandler. This returned object is responsible for handling the incoming request. The type of this object depends on the options you configure on your Web methods. If the Web method being requested uses ASP.NET sessions, then the returned object is a otherwise it is a r as shown in figure 10-1. This HttpHandler object eventually instantiates your Web service class, invoke s the requested...

Summary

SOAP Extensions provide an extensibility mechanism for adding custom behavior to Web service request response processing. By encapsulating i nfrastructure services such as security and usage accounting in SOAP extensions, you can build a reusable, flexible, infrastructure components. Developers can apply such components to their Web services using web.config files or CLR custom attributes. 1 There were no implementations of WS-Security at the time of this writing. Therefore it didn't make sense...

Controlling SOAP Message Style

.NET Web services use document literal SOAP messages by default. This is generally acceptable as messaging Web services are centered on XML documents and their schemas. In some cases however, you ll need to use RPC encoded SOAP messages. For example, if you want to expose your Web service to clients that understand only RPC encoded SOAP. At the Web service level, you control the style of SOA P message by applying SoapRpcService or SoapDocumentService the default attributes to the class that...

XML and XSD

Extensible Markup Language XML is the basic format for representing data on the Web services platform. In addition to being simple to create and parse, XML was chosen because it is neither platform nor vendor specific. Being neutral is more important than being technically superior Software vendors are much more likely to adopt a neutral technology rather than one t hat was invented by a competitor. XML provides a simple way of representing data, but it says nothing about the standard set of...

Extending Web Service Request Processing

If you take another look at the request processing diagram in figure 10-1, you'll notice dashed lines indicating additional processing between the HttpHan dlers and your Web service class. In fact, you can perform your own custom request processing by creating classes that inherit and inserting them along the request processing path between the HttpHandler and your Web service. Such classes, called SOAP extensions, allow you to perform pre and post processing by operating directly on the SOAP...

Using SOAP Headers

After logging on and obtaining a session id, a client m ust send this session id with each subsequent request. A good way to do this is through a SOAP head er that the client sends with each request. Although you could also use HTTP cookies to get back the session id with each request, a SOAP header is better because it is independent of the transport protocol which means you can continue to use this architecture even if you decide HTTP is no good and switch to TCP or some other transport. The...

Typed Data Sets from Schemas

To create the DataSet structure at design time, you use a tool such as xsd.exe, to read the XML schema and generate a set of classes that represent a typed DataSet. As you saw in Chapter 2, xsd.exe is a command line tool that can create classes from XML Schemas and vice versa. In total, xsd.exe can do four different but related things Create typed DataSets in VB, C , or JScript from an XML schema Create VB, C , or JScript classes from an XML schema Create a schema from types in a compiled...

Validating with XSD

In addition to acting as a specification for a class o f XML documents, an XSD schema can also be used to validate XML documents. To do this, you need to use a validation program, which is capable of checking an XML document against a schema and reporting validation errors. In general, there are two categories of such programs Parsers and XML XS D editors. When building your application and designing your XML documents and schemas, you typically use a schema editor. When your application is...

WSDL Overview

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. 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. Two clients invoking a Web service. Client A is using SOAP over HTTP while...

SOAP with Attachments

The SOAP with Attachements specification defines how a SOAP message can be transmitted along with arbitrary binary content such as images and files in their original format and all combined into one document. This document is called a MIME multipart related message and contains several parts, one containing the SOAP message and one for each individ ual binary content, each part with a unique content id. Listing 3-17 shows an example message from the SOAP with Attachements specification. Listing...

PublisherAssertion

While UDDI defines a structure called businessEntity, in reality, this structure represents an entity that provides one or more services. This entity need not be a business, it could be a department within a business or for a multi-national corporation, it could be a business branch in a specific country. The result is that practically, different parts or branches of a multi-national corporation or a government will be represented by different UDDI businessEntity structures creating the need to...

Capturing SOAP Messages

Throughout this chapter and indeed the rest of the bo ok, you'll need a way to capture SOAP messages exchanged between client and service for learning and troubleshooting purposes. There are a few free tools that allow you to do this easily. One of those tools, Trace Utility, comes with the Microsoft SOAP Toolkit and can be used to intercept and record SOAP messages between the client and server. The tool works by inserting itself between the client and the Web server where your Web service is...

Exposing Web Services

Now that you understand when and why you'd expose COM components and Web services, let's examine the how. This section covers the mechanics of exposing COM components using the SOAP Toolkit's high level API. To expose a COM component, you need a WSDL document that describes the Web service operations as explained in chapter 4. When using the high level API, you also need a WSML document which maps services to COM components and service operations to interface methods. Instead of creating these...

Object Serialization

Listing 2-2-8 Example invoice document sent to SubmitInvoice. lt invoiceItems gt lt InvoiceItem gt lt partNum gt 58 lt partNum gt lt quant gt 50 lt quant gt lt total gt 662.5 lt total gt lt InvoiceItem gt lt invoiceItems gt invoiceDate gt lt poNumber gt AX0192 lt poNumber gt lt subTotal gt 662.5 lt subTotal gt lt salesTax gt 29.81 lt salesTax gt lt paymentReceived gt 0 lt paymentReceived gt lt amtDue gt 692.31 lt amtDue gt lt terms gt Net 30 days lt terms gt lt contactName gt John Smith lt...

Exposing Services with Low Level API

Because of the simplicity, control, and consistency, I recommend you use the low-level API to invoke existing COM components. When using the low level API to expose Web services, there are two primary objects you interact with, SoapReader30 and SoapSeri alizer30 as shown in figure 5-13. You use SoapReader30 to read from incoming SOAP messages and use SoapSerializer30 to write to outgoing SOAP messages. I will not go into the details of every method and property on these two objects, that would...

Inheritance interfaces and serialization

Consider again the dessert example, how would you serialize the DessertMenu The problem here is that the menu contains three Dessert items Iteml, Item2, and Item3 that actually contain objects of the derived types IceCream and Cake. The serializer cannot serialize the menu unless you tell it about the derived types IceCream and Cake. To do this, you add an XmlInclude attribute on the base class Dessert for each of the derived types IceCream and Cake as shown in listing 2-17. The serializer...

Section 5 Encoding

The majority of the SOAP specification is in Section 5 which represents about 40 of the specification in terms of number of pages. It includes detailed rules o n serializing application data including arrays and objects which are implemented by most SOAP stacks available today. Although Section 5 is a major part of the SOAP specification, I won t go into its details because the tools you use, such as the SOAP Toolkit and .NET, will support Section 5 encoding for you so t hat you do not need to...

Applying SOAP Extensions with CLR Attributes

In many cases, you'll want to apply your SOAP extension to specific methods of the Web service rather than to all methods. You can do this by applying custom CLR attributes much like the XML serialization attributes you've seen throughout this book. First, the SOAP extension creator must create a custom attribute specific to this extension. Then developers who want to use this SOAP extension apply the custom attribute to one or more Web methods on thei r services. To create a custom attribute...

Quote Of The Day Wsdl

The Quote of The Day Web service is also live on the Web at http www.lemurlabs.com 80 rpcrouter. It s actually called the Fortune service but it really doesn't return fortunes, just quotes and word definitions. Although this Web service is written in Java and uses the Apache SOAP implementation, you'll be able to call it just like the first two Web services without any problems. Listing 4-17 shows the WSDL for this Web service. Listing 4-17 WSDL for Quote of The Day service. lt definitions name...

WSDL Imports

In many of the previous examples, I separated the lt types gt section into a separate listing to make the document easier to read. You might want to do the sa me in a production environment for readability as well as reusability of WSDL documents. For example, if a team of developers is building several Web services, there might be a need to reuse some of the type definitions or other parts of the WSDL across those Web services. You can do this by separating out the various pieces that you want...

The Web Service

To show you how easy it is to create and process the messages in Listing 3-3, I created the example Web service in classic ASP using only the Microsoft XML parser MSXML version 4.0 as shown in Listing 3-5. Listing 3-5 A classic ASP page that acts as a SOAP endpoint. VBWSServer VBWSBook Chapter3 MessagingWS invoiceMessaging.asp . lt Language VBScript gt e WSBook uid sa pwd Set 'Load the SOAP message requestDoc.async false If Not requestDoc.Load Request Then Call SendFault soap Client, _ Error...

Tweaking the Isapi Listener

There are a few settings you might want to tweak when using the ISAPI listener in a production application. These settings are registry values located in the registry key MaxPostSize is important to configure if your expect request messages that exceed 100KB in size which is the default permissible size. When you change this setting, be sure to switch to Decimal base and keep in mind that 1 KB 1024 Bytes. NoNagling turns off the nagling delay. By default, when a service responds with a small...

Exposing Services with Headers

Consider the simple server class called Stores in listing 5-15. This server exposes two properties named UserId and Password. At runtime, it assumes these properties have been populated before GetStoreSales is called. Listing 5-15 A GetStoreSales implementation that relies on SOAP headers for getting user id and password Private Const UID As String admin Private Const PWD As String admin Private m_UID As String Private m_PWD As String Public Function GetStoreSales ByVal StoreId As String As...

HTTP Binding

All the examples you ve seen in this chapter used the WSDL SOAP binding to describe how operations can be invoked using SOAP. The WSDL specification also d efines a binding for invoking operations using HTTP GET or POST requests. While this is not something you d want to do for new Web services, it is a good feature for exposing parts of an existing Web application as a Web service. For example, I created an ASP page called prodCheck.asp for retrieving product information similar to the Product...

Documentliteral Example

Once you know how to handle complex types with the Web service behavior, invoking document literal services is no different You access the returned mess age using result.raw. As an example, I wrote some code to invoke the GetCustomersXml operation from chapter 9. Since the client is browser-based, it's likely you'll want to transform the returned XML to HTML for display. To do this, I used an XSLT stylesheet and the MSXML2.DOMDocument object. Listing 12-12 s hows the example code. Listing 12-12...

The Request ElementBare Dilemma

Looking at the LogOn method in listing 13-4, you'll notice that the ParameterStyle property is missing from the SoapDocumentMethod attribute hence the default which is SoapParameterStyle.Wrapped will apply. This means that parameters will be wrapped in a request element and the return value will be wrapped in a response element. The reasons why I had to do this are explained in the next few paragraphs. When you tell .NET to ignore the SOAPAction header by setting RoutingStyle to RequestElement...

Implementing Multiple Interfaces

The next logical step would be to implement multiple interfaces on the same Web service. You do this by applying multiple WebServiceBinding attributes to the class implementing the Web service. On each Web method you then set the SoapDocumentService or Soa pRpcService Binding property to the name of the binding that contains this method. Taking the SupplierIfacel class in listing 8-1, you might want to factor its methods out into two interfaces One called IOrderMgmt and the other called...

Handling Object Arrays

Chapter 2 covered XML serialization and showed you examples of serializing custom objects and arrays to XML. In this section, we'll take that one step further and build a Web method that returns an array of objects. We'll then build a client that calls this method and binds a data grid to the returned array. Listing 9-21 shows a Customer class that has two properties CompanyName and CustomerID. Listing 9-21 An example Customer class. VBWSBook C hapter9 Customer.vb . _ Public Class Customer...

Invoking Services with Headers

In addition to exposing services that require SOAP headers, the toolkit also lets clients send and receive headers when invoking services. Listing 5-17 shows an example class called AuthHeader that implements IHeaderHandler to send a user id and password as a SOAP header. Note that this AuthHeader class is not the same AuthHeader class used by the server. The server's implementation is concerned with reading a SOAP hea der while the client implementation writes the SOAP header. Listing 5-17 An...

Defining Interfaces

Public Structure OrderItem Public ProductID As Integer Public Quantity As Integer End Structure Public Enum Shipper FedEx 1 UPS USPS End Enum Public Enum OrderStatus Pending Shipped Delivered End Enum Public Structure OrderInfo Public Status As OrderStatus Public ShippingType As String Public DeliveredDate As Date Public DeliveredTo As String End Structure Public Structure QuoteInfo Public ProductCost As Double Public Tax As Double Public Shipping As Double Public TotalCost As Double End...

The Isapi Listener

All examples in this chapter have used an ASP listener to receive and process S0AP requests. The toolkit's documentation recommends that you use an ISAPI listener for maximum performance. I haven't run benchmarks comparing the performance of ISAPI vs. ASP listeners but I intuitively agree with the documentation's recommendation. You should use an ASP listener only if you want to pre-process incoming S0AP messages before passing them on to SoapServer30, otherwise you should use an ISAPI...

Distributed transactions

In certain scenarios, you might want a Web method to act as the root of a distributed transaction so that all transactional components that are invoked from th at method participate in one transaction. There are two scenarios when distributed transactions make sense If the Web method needs to do work against two or more transactional resources for example updating two relational databases or inserting into a database and writing to a transactional message queue. The second scenario is when the...

Customizing the Documentation Page

When a user uses a browser to navigate to the Web se rvice end point e.g. weather.asmx he or she will get a standard help page that lists the Web service's methods. This help page is generated by the file DefaultWsdlHelpGenerator.aspx. We need to customize this page to inform the user that this service requires registration and give him or her a link to the registration page. The name of the default help page is specified in mac hine.config in the section called WebServices lt wsdlHelpGenerator...

Understanding Web Service Clien ts

Inheritance hierarchy for a Web service proxy class. T he classes at the bottom of the hierarchy are Web service proxies A Web service proxy class that uses SOAP inherits from SoapHttpClientProxy. Similarly, if the proxy uses HTTP GET or POST, it inherits from HttpGetClientProtocol or HttpPostClientProtocol respectively. Each class in this inheritance hierarchy is responsible for a different portion of the task of sending a Web service request and receiving the response. For example,...

Creating A Web Service

Although you can create a Web service by creating an .asmx file with any text editor, using Visual Studio .NET makes it easy to code and debug Web services. Simply start Visual Studio .NET and choose File, New, Project then choose the ASP.NET Web Service project template. In the location field, enter the URL where you want the new project to be located. T he project name is automatically derived from the last segment of this URL the word after the last forward slash . The project name is...

Ignoring Specifying SOAP Action

By default, the SOAP Action HTTP header value is generated by combining the Web service namespace with the operation method name. Also by default, .NET reads the SOAP Action value for each Web service request and uses it to determine which operation is to be invoked. Although this will work for most cases, you re better off not relying on SOAP Action at all because it is a highly controversial topic in the SOAP world today. At the time of this writing, the SOAP 1.2 W3C Working Draft states that...

PocketSOAP Clients

To send a SOAP request, you begin by creating a CoEnvelope object. CoEnvelope exposes properties that let you set various parts of the physical SOAP Envelope including MethodName name of the Web service operation and URI namespace of the Web service operation . CoEnvelope also exposes Web service operation parameters as a collection of CoSoapNode o bjects. Each CoSoapNode represents an XML element inside the message's Body. Using CoSoapNode you can set read all aspects of the corresponding XML...

Compression SOAP Extension

Private _workStream As CompressDecompressStream Public Overloads Overrides Function GetInitializer _ ByVal serviceType As System.Type As Object Dim compressionType As String compressionType _ If Not compressionType Is Nothing Then Select Case compressionType.ToLower Case gzip Return CompressionTypes.GZip Case Else Return CompressionTypes.None End Select Else Return CompressionTypes.GZip End If End Function Public Overloads Overrides Function GetInitializer _ ByVal methodInfo As...

Documentliteral Messages with PocketSOAP

In addition to RPC encoded messages, PocketSOAP also supports document literal messages. To show you an example of this, I built a PocketSOAP client that invokes the GetCustomersDataSet operation explained in Chapter 9. Running this sample invokes the operation and displays the returned data in a listview as shown in figure 12-3. Listing 12-3 shows the sample cl ient code. Ana Truiillo Emparedados y helados IM Using PocketSOAP to invoke a document literal service and displaying the results....

Enabling Output Caching

ASP.NET output caching lets you retain in memory the output from a Web method for a specified period of time. During this time, requests to the same method with the same parameter values will get the output directly from cache without really invoking the Web method. This works well for Web methods designed to return data without having any side effects on the server. For example, a Web method that returns the current temperature for a given zip code would benefit from output caching. To enable...

Writing the Service Code

Now you actually get to write some code. Start by cre ating a Web service project then add to it the CurrentWeather class that was previously generated. Then add a Web service named Weather. Open the code view for this Web service and add Import statements for System.Web.Services.Protocols and System.Xml.Serialization namespaces. This service should ignore SOAPAction as specified in the requirements section, therefore add to the Web service class a SoapDocumentService attribute and set its...

Complex types as Ixmldomnode List

Instead of playing the serialization deserialization game, you could instead use XML as the native data format within your applications. This lets you easily d eposit XML in outgoing SOAP messages and pull out XML from incoming messages without the need for complicated serialization deserialization logic. In my opinion, using XML as your application's internal data format has many benefits over using classes as data containers. Here's a list of these benefits Less code Even though it might seem...

VB 6 Clients

Dim Serializer As SoapSerializer30 Dim Connector As SoapConnector30 Dim Rdr As SoapReader30 Set Connector New HttpConnector30 SERVICE_URL SOAP_ACTION If chkPrxy.Value Then localhost 8080 True End If 'establish connection Connector.Connect Connector.BeginMessage 'SoapSerializer uses the Connector Set Serializer New SoapSerializer30 Serializer.Init Connector.InputStream 'write the SOAP message Serializer.StartEnvelope Serializer.StartBody Serializer.StartElement OPERATION_NAME, _ OPERATION_NS, _...