NELIXINC
asked on
Need to remove Soap envelope to parse XML response
I am using asp.net 2.0 and a webservice that returns XML data as a string.
I am able successfully load the xml with XMLDocument.LoadXML(strXML ). The response is inside a soap envelope in a plain text format.
How do I access the xml values ('LoginResponse' and SECTOKEN) as XML nodes without resorting to string manipulation (i.e. chopping off the soap enveleope, or using instr(SECTOKEN) to find the value).
That is, how do I remove the soap and get to the good stuff?
Example XML response below.
Thanks!
I am able successfully load the xml with XMLDocument.LoadXML(strXML
How do I access the xml values ('LoginResponse' and SECTOKEN) as XML nodes without resorting to string manipulation (i.e. chopping off the soap enveleope, or using instr(SECTOKEN) to find the value).
That is, how do I remove the soap and get to the good stuff?
Example XML response below.
Thanks!
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns:iws0005lResponse xmlns:ns="http://login.wsbeans.iseries/xsd"><ns:return><ns:_LS_OUTPUT_PARM_BUFF_STRUCT><ns:_LS_OUTPUT_PARM_BUFF><?xml version="1.0" encoding="UTF-8"?>
<LoginResponse result="SUCCESS">
<SECTOKEN>4BC952DED0D2BA39A714F3BEB2A8787D71041A02F60A1C5527807B</SECTOKEN>
</LoginResponse>
</ns:_LS_OUTPUT_PARM_BUFF><ns:_LS_OUTPUT_PARM_BUFF></ns:_LS_OUTPUT_PARM_BUFF><ns:_LS_OUTPUT_PARM_BUFF></ns:_LS_OUTPUT_PARM_BUFF><ns:_LS_OUTPUT_PARM_BUFF></ns:_LS_OUTPUT_PARM_BUFF></ns:_LS_OUTPUT_PARM_BUFF_STRUCT></ns:return></ns:iws0005lResponse></soapenv:Body></soapenv:Envelope>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER