CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2009
    Posts
    11

    Accessing SOAP xml data with classic ASP

    I've got a string variable, named strMethodResultXML, that has the contents of a SOAP xml response and would like to output only the actual data to the browser screen.

    I'm using this: Response.Write strMethodResultXML

    However, the output isn't correct and when I view the source code in the browser, it's outputting all the xml with the tags.

    Any help?

    Thank you.

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    Re: Accessing SOAP xml data with classic ASP

    Your problem would be how you are setting strMethodResultXML. By the sound of it, you are probably retrieving the XML structure and not just the response text.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  3. #3
    Join Date
    Jul 2009
    Posts
    11

    Re: Accessing SOAP xml data with classic ASP

    Here's my exact code:

    Code:
    <&#37;
    Dim objXMLHTTP : SET  objXMLHTTP = Server.CreateObject("Msxml2.XMLHTTP.3.0")
    Dim objOutputXMLDoc : Set objOutputXMLDoc = Server.CreateObject("MSXML.DOMDocument")
     
    Dim strMethodPkg
    Dim strMethodResultXML
     
    strMethodPkg ="<?xml version=""1.0"" encoding=""ISO-8859-1""?>"
    strMethodPkg = strMethodPkg &"<SOAP-ENV:Envelope SOAP-ENV:encodingStyle=""http://schemas.xmlsoap.org/soap/encoding/"" xmlns:SOAP-ENV=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:SOAP-ENC=""http://schemas.xmlsoap.org/soap/encoding/"">"
    strMethodPkg = strMethodPkg &"<SOAP-ENV:Body>"
    strMethodPkg = strMethodPkg &"<ns9005:showSearchForm xmlns:ns9005=""http://tempuri.org"">"
    strMethodPkg = strMethodPkg &"</ns9005:showSearchForm>"
    strMethodPkg = strMethodPkg &"</SOAP-ENV:Body>"
    strMethodPkg = strMethodPkg &"</SOAP-ENV:Envelope>"
    
     
    objXMLHTTP.open "post", "http://www.webservicesite.com/service.wsdl", False
     
    objXMLHTTP.setRequestHeader "Content-Type", "text/xml; charset=ISO-8859-1"
    objXMLHTTP.setRequestHeader "Content-Length", Len(strMethodPkg)
     
     
    objXMLHTTP.setRequestHeader "SOAPAction", "http://www.webservicesite.com/service.wsdl"
     
    Call objXMLHTTP.send(strMethodPkg)
     
    
    strMethodResultXML = objXMLHTTP.responsetext
    
    
    Response.Write strMethodResultXML
    %>
    Last edited by PeejAvery; July 30th, 2009 at 09:21 PM. Reason: Added code tags.

  4. #4
    Join Date
    May 2002
    Posts
    10,943

    Re: Accessing SOAP xml data with classic ASP

    Your code is correct. It should just be giving you text. So, it would seem that the text being send back is HTML encoding. I bet you aren't receiving < and > signs, but instead &lt; and &gt;.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  5. #5
    Join Date
    Jul 2009
    Posts
    11

    Re: Accessing SOAP xml data with classic ASP

    Yes, the SOAP data response I receive contains HTML tags (such as a table) and they do display as entities. I'm also having this problem with .NET, but with NuSoap in PHP the data appears as a table when I output it to the browser.

  6. #6
    Join Date
    May 2002
    Posts
    10,943

    Re: Accessing SOAP xml data with classic ASP

    Quote Originally Posted by KnightDeveloper View Post
    I'm also having this problem with .NET, but with NuSoap in PHP the data appears as a table when I output it to the browser.
    Are you sure that it is actual tables and not just XSLT styling to make it look like tables?
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured