Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

response from xml POST

Status
Not open for further replies.

onressy

Programmer
Mar 7, 2006
421
CA
Hi peoples,

I successfully send an xml pack wrapped in a SOAP envelope using calssic ASP. I was returned this response from what i sent:

Code:
<soapenv:Envelope xmlns:soapenv="[URL unfurl="true"]http://schemas.xmlsoap.org/soap/envelope/"[/URL] xmlns:xsd="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema"[/URL] xmlns:xsi="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema-instance">[/URL]
<soapenv:Body>
<ns1:receiveValidationXMLMessageResponse soapenv:encodingStyle="[URL unfurl="true"]http://schemas.xmlsoap.org/soap/encoding/"[/URL] xmlns:ns1="[URL unfurl="true"]http://company.com">[/URL]
<receiveValidationXMLMessageReturn xsi:type="soapenc:string" xmlns:soapenc="[URL unfurl="true"]http://schemas.xmlsoap.org/soap/encoding/">&lt;response[/URL] chainID=&quot;RK&quot; companyID=&quot;DS&quot; propertyID=&quot;100015&quot; requestID=&quot;RK-DS-100015-20060815082019020&quot; status=&quot;OK&quot; time=&quot;20060815111804&quot; queue=&quot;HccJMS020&quot;&gt;
   &lt;message text=&quot;Your xml passed the validation,update is processing&quot; code=&quot;PENDING&quot;/&gt;
&lt;/response&gt;
</receiveValidationXMLMessageReturn>
</ns1:receiveValidationXMLMessageResponse>
</soapenv:Body>
</soapenv:Envelope>

There is a part in there that is: status=&quot;OK&quot;

How can i parse the status value?

This is a tough post as i'm not sure if i should be posting it in the asp forum or xml, thought i'd try here first.

Thanks
 
Judging from you previous posts, you might as well start here...

I am a bit concerned about the server; the response is probably not intended to be this convoluted. The text node of the SOAP envelope' response appears to be an XML document that has been escaped. So, it would appear to be up to you to fetch the text node /soapenv:Envelope/soapenv:Body/ns1:receiveValidationXMLMessageResponse/receiveValidationXMLMessageReturn and treat that text as if it were an XML document from which you retrieve the value of /response/@status.

But I am probably wrong. :-D

Tom Morrison
 
[tt]
sdata=""
set onode=responseXML.selectsinglenode("//receiveValidationXMLMessageReturn")
if not (onode is nothing)
s=onode.text
set rx=new regexp
with rx
.global=false
.ignorecase=false
.pattern="\bstatus\b\s*=\s*""(.*?)"""
end with
set cm=rx.execute(s)
if cm.count<>0 then
sdata=cm(0).submatches(0)
end if
set cm=nothing
set rx=nothing
end if
[green]'sdata is the OK or else; anything unexpected it be empty[/green]
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top