i need to parse this response of soapserver:
<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
<SOAP-ENV:Header>
<wsa:MessageID SOAP-ENV:mustUnderstand="0">uuid:5f7271f0-de19-11e1-8035-e656d1754971</wsa:MessageID>
<wsa:To SOAP-ENV:mustUnderstand="0">http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns1:wssigatewayResponse xmlns:ns1="urn:it-progress-operate:ws_operate">
<ns1:result xsi:nil="true"/>
<ttOut xmlns="urn:it-progress-operate:ws_operate">
<ttOutRow xmlns="urn:it-progress-operate:ws_operate">
<ParPos xmlns="urn:it-progress-operate:ws_operate">0</ParPos>
<ParNam xmlns="urn:it-progress-operate:ws_operate">ContentType</ParNam>
<ParVal xmlns="urn:it-progress-operate:ws_operate">text/xml</ParVal>
</ttOutRow>
<ttOutRow xmlns="urn:it-progress-operate:ws_operate">
<ParPos xmlns="urn:it-progress-operate:ws_operate">1</ParPos>
<ParNam xmlns="urn:it-progress-operate:ws_operate">Result</ParNam>
<ParVal xmlns="urn:it-progress-operate:ws_operate">200</ParVal>
</ttOutRow>
<ttOutRow xmlns="urn:it-progress-operate:ws_operate">
<ParPos xmlns="urn:it-progress-operate:ws_operate">2</ParPos>
<ParNam xmlns="urn:it-progress-operate:ws_operate">XMLDocumentOut</ParNam>
<ParVal xmlns="urn:it-progress-operate:ws_operate"><?xml version="1.0" encoding="utf-8" ?>
<DtsAgencyLoginResponse xmlns="DTS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="DTS file:///R:/xsd/DtsAgencyLoginMessage_01.xsd"><SessionInfo><SessionID>178918</SessionID><Profile>A</Profile><Language>ENG</Language><Version>1</Version></SessionInfo><AdvisoryInfo/></DtsAgencyLoginResponse></ParVal>
</ttOutRow>
</ttOut>
<ns1:opcErrorMessage/>
</ns1:wssigatewayResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
How can i get SessionID from ParVal in the last ttOutRow?
Load the SOAP response into an
DOMDocument
object:Prepare a
DOMXPath
object for that document:Register a prefix for the
urn:it-progress-operate:ws_operate
namespace:Retrieve the payload node:
Save the payload XML:
Now that you have the payload XML string, go through the process again:
DTS
namespaceIt's probably best to wrap the whole process into a function so you can re-use it.