ASP
  Home arrow ASP arrow Page 4 - An Introduction To XML SOAP Using ASP and ...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP

An Introduction To XML SOAP Using ASP and VB6
By: ComponentSource Team
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 27
    2002-08-12

    Table of Contents:
  • An Introduction To XML SOAP Using ASP and VB6
  • Step By Step
  • The Server
  • VB Client Code
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    An Introduction To XML SOAP Using ASP and VB6 - VB Client Code


    (Page 4 of 5 )

    Here's the entire code for your VB client:

    Sub Main()
    Dim objHTTP As New MSXML.XMLHTTPRequest
    Dim strEnvelope As String
    Dim strReturn As String
    Dim objReturn As New MSXML.DOMDocument
    Dim dblTax As Double
    Dim strQuery As String

    '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=""urn:myserver/soap:TaxCalculator"">" & _
    "<salestotal>100</salestotal>" & _
    "</m:getsalestax>" & _
    "</soap:body>" & _
    "</soap:envelope>"

    'Set up to post to our local server
    objHTTP.open "post", "http://localhost/soap.asp", False

    'Set a standard SOAP/ XML header for the content-type
    objHTTP.setRequestHeader "Content-Type", "text/xml"

    'Set a header for the method to be called
    objHTTP.setRequestHeader "SOAPMethodName", _
    "urn:myserver/soap:TaxCalculator#GetSalesTax"

    'Make the SOAP call
    objHTTP.send strEnvelope

    'Get the return envelope
    strReturn = objHTTP.responseText

    'Load the return envelope into a DOM
    objReturn.loadXML strReturn

    'Query the return envelope
    strQuery = _
    "SOAP:Envelope/SOAP:Body/m:GetSalesTaxResponse/SalesTax"
    dblTax = objReturn.selectSingleNode(strQuery).Text

    Debug.Print dblTax
    End Sub


    ASP Server Code
    This code resides in an ASP – Soap.asp, in the root directory of the web server.

    <%
    Set objReq = Server.CreateObject("Microsoft.XMLDOM")

    'Load the request into XML DOM
    objReq.Load Request

    'Query the DOM for the input parameter
    strQuery = "SOAP:Envelope/SOAP:Body/m:GetSalesTax/SalesTotal"
    varSalesTotal = objReq.SelectSingleNode(strQuery).Text

    'Calculate the sales tax
    varSalesTax = varSalesTotal * 0.04

    'Prepare the return envelope
    strTmp = _
    "<soap:envelope xmlns:soap=""urn:schemas-xmlsoap-org:soap.v1"">" & _
    "<soap:header></soap:header>" & _
    "<soap:body>" & _
    "<m:getsalestaxresponse xmlns:m=""urn:myserver/soap:TaxCalc"">" & _
    "<salestax>" & varSalesTax & "</salestax>" & _
    "</m:getsalestaxresponse>" & _
    "</soap:body>" & _
    "</soap:envelope>"

    'Write the return envelope
    Response.Write strTmp
    %>

    More ASP Articles
    More By ComponentSource Team


     

    ASP ARTICLES

    - Central Scoreboard with Flash and ASP
    - Calorie Counter Using WAP and ASP
    - Creating PGP-Encrypted E-Mails Using ASP
    - Be My Guest in ASP
    - Session Replacement in ASP
    - Securing ASP Data Access Credentials Using t...
    - The Not So Ordinary Address Book
    - Adding and Displaying Data Easily via ASP an...
    - Sending Email From a Form in ASP
    - Adding Member Services in ASP
    - Removing Unconfirmed Members
    - Trapping HTTP 500.100 - Internal Server Error
    - So Many Rows, So Little Time! - Case Study
    - XDO: An XML Engine Class for Classic ASP
    - Credit Card Fraud Prevention Using ASP and C...







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    Stay green...Green IT