|
-
July 30th, 2009, 01:29 PM
#1
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.
-
July 30th, 2009, 01:51 PM
#2
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.
-
July 30th, 2009, 06:16 PM
#3
Re: Accessing SOAP xml data with classic ASP
Here's my exact code:
Code:
<%
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.
-
July 30th, 2009, 09:38 PM
#4
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 < and >.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
July 31st, 2009, 12:04 PM
#5
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.
-
July 31st, 2009, 12:32 PM
#6
Re: Accessing SOAP xml data with classic ASP
 Originally Posted by KnightDeveloper
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|