Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17



Posted on 2002-04-15
Medium Priority
Last Modified: 2012-05-04
I have read "gigabytes" of articles on the net regarding XML, SOAP, Web Services... but I would like a good solid opinion from someone here.

For the purpose of various apps utilizing VB, ASP, and SOAP (ALSO using SSL), what would be the advantage of using the MS Soap Toolkit MSSOAP vs just using SOAP/XML over XMLHTTP and serverXMLHTTP in the MSXML3?  As I said, I have read lots about both, but I want a direct discussion from someone knowledgeable.

I can be generous if I feel extra enlightened!
Question by:vbPhil
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
LVL 15

Expert Comment

by:Tommy Hui
ID: 6943381
Think of it this way:

You use VB because it hides all the details about programming the CPU using assembly language. You don't want to think about registers or direct memory access. Instead, you think of objects. VB simulates these objects for you.

The same is true for SOAPToolkit compared to XML. XML is the low-level stuff. You will have to know about WSDL and how to interpret the objects passed by SOAP services (Web services) if you used XML directly. You will have to know about how to create SOAP messages. The SOAP Toolkit hides a lot of details for you. If you are doing anything with SOAP using VB, this is toolkit to use.

Author Comment

ID: 6943960
From what I've studied, there is little if anything saved in complexity with the Soap Toolkit.  Manipulating the DOM, XML Documents, and creating SOAP Envelope structures is not a concern.

If I don't have to worry about distributing the Toolkit DLL I'd rather not.  What I am looking for is what technical advantage will I be missing if I do not use the Soap Toolkit?  
LVL 15

Expert Comment

by:Tommy Hui
ID: 6944051
Here's a sample SOAP client application. Notice the simplicity of the program. I would hate to write/debug/test the SOAP messages needed to call the web service. Not that you couldn't but why rewrite the code when you don't have to?

Dim soapClient
set soapclient = CreateObject("MSSOAP.SoapClient")
' On Error Resume Next
Call soapclient.mssoapinit("", "Service1", "Service1Soap")
if err <> 0 then
    wscript.echo "initialization failed " + err.description
    DIM xmlNode
    wscript.echo soapclient.GetQuote("MSFT.O")
end if
wscript.echo "Done"

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.


Author Comment

ID: 6944877
Here is a sample client application, using the xmlHTTP object from msxml2.  Except for constructing the SOAP Envelope, why is this any more complex?  As I said, I'm not concerned with how to write the code...

I want to know if there is a Reason in the "underlying technology" to use one or the other.

Dim objHTTP
Dim objReturn

Set objHTTP = CreateObject("MSXML2.XMLHTTP30")
Set objReturn = CreateObject("MSXML2.DOMDocument30")

'Create the SOAP Envelope
strEnvelope = _
   "<SOAP:Envelope xmlns:SOAP=""urn:schemas-xmlsoap-org:soap.v1"">" & _
   "<SOAP:Header></SOAP:Header>" & _
   "<SOAP:Body>" & _
   "<m:GetSalesTax xmlns:m="""">" & _
   "<SalesTotal>" & Trim(txtSalesTotal.Text) & "</SalesTotal>" & _
   "</m:GetSalesTax>" & _
   "</SOAP:Body>" & _
   "</SOAP:Envelope>" "post", "", False
objHTTP.setRequestHeader "Content-Type", "text/xml"
objHTTP.setRequestHeader "SOAPMethodName", ""
objHTTP.send strEnvelope
strReturn = objHTTP.responseText

Expert Comment

ID: 6946601
LVL 15

Accepted Solution

Tommy Hui earned 800 total points
ID: 6949203
Let's say that your SOAP services was updated. It added a new parameter to your function, or maybe even the function has changed name. Using SOAPToolkit, you have to add the new parameter or changed the function name. Using pure XML, you have to change the entire XML document sent over to the server.

I'm saying it is harder because you have to enter more lines of code into your program. Every line you add increases the chance of it not working. It also means that you have to change more lines of code should the server change.

Libraries are created to simplify your life. SOAPToolkit does this by making the SOAP services available to your application as if it were a function call. It has all of the code to serialize your parameters to the proper SOAP type. It handles the deserialization of SOAP objects to the proper COM object. If you don't want this benefit, you would have to write the same code anyway to properly make SOAP requests and handle SOAP replies.

In your case, it is simple because the parameters and return values are simple. What if the parameters expect an object? What if the return value is an object or an array? How much code would you have to write to handle these cases? What if your tax service gets changed to return not just the total, but also the percentage that was used? What if your tax service needs a city and state as its parameter so that it can use the proper percentage?


Author Comment

ID: 6951647
Ok thui...

Still not quite the argument I was looking for.  I understand how components can simplify coding requirements.  What I was looking for was more of a discussion about how MSSOAP interacts with the IIS in ASP, as opposed to MSXML and if either method was better suited to SSL.  Things like that.

But, your comments are well received and since you took the time to have this discussion, you can have the points.

LVL 15

Expert Comment

by:Tommy Hui
ID: 6964185
Sorry, I just recently moved so I have spotty network connections until my DSL is in...

I think I understand better what you're looking for. SOAP is geared towards object communication between a client and a server. You can think of it as a protocol that sits on top of a transport. The transport is determined by you. SOAP can use SMTP (e-mail), HTTP, HTTPS, and anything else as long as there is a handler for the transport. SOAP takes care of serializing the object's state to XML. It passes the SOAP (specialized XML) packet to the transport. SOAP also takes care of deserializing the SOAP packets. SOAP does not care who transport you use, nor does it care about any other technology. Therefore it does not interact with IIS. Although if you did use HTTP, then it must interact with a web server, but it does not have to be IIS.

XML is the underlying technology for SOAP (i.e. SOAP uses it heavily). XML also does not care about transport, in fact, XML itself really does not care about where you get the XML document from. You can create one from scratch, load it from a file or pull it from a database. But MSXML (Microsoft's implementation) has a unique feature in that you can pull an XML file from not just the local disk, but also from a web server. In this one specific case, MSXML and SOAP seems to overlap, but in reality, it doesn't. SOAP when used with HTTP or HTTPS will use the HTTP protocol to retrieve a SOAP packet. The SOAP packet in an XML packet that contains SOAP specific information. MSXML however, will load an XML packet (or document or fragment) from an HTTP server. This XML packet can be any XML packet. Using MSXML, you can then traverse the XML DOM to see what was retrieved. Using SOAP, an object will be returned whereupon you can see what properties it has.

Another aspect to be careful of is that MSXML is client technology. Microsoft does not recommend using MSXML on the server side. For example, you shouldn't use VBScript code in an ASP page that uses MSXML. There would be scalability issues.

Instead, you should use XMLServerHttp. This component provides similar functionality as MSXML to pull an XML document from another server. This component can be used on the server (i.e. within an ASP page).

I hope this addresses your question better.

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question