I've been asked to create a piece of code that connects to a webservice, sends some information and handles the response.
Sending and collecting the response goes fine, but when trying to handle the response, I'm stomped by a blank namespace declaration
The responsexml I get is:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<SendOrderResponse xmlns="http://tempuri.org/">
<SendOrderResult xmlns:a="http://schemas.datacontract.org/2004/07/Scalepoint.Web.EasyClaims.Webservices.DealerManagement" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:Description>...</a:Description>
<a:ResultCode>SCHEMA_VALIDATION_ERROR</a:ResultCode>
<a:ResultDetails i:nil="true"/>
</SendOrderResult>
</SendOrderResponse>
</s:Body>
</s:Envelope>
To handle this I have:
// Create NameSpacemanager
XmlNamespaceManager := XmlNamespaceManager.XmlNamespaceManager(XmlDocument.NameTable);
XmlNamespaceManager.AddNamespace('s','http://schemas.xmlsoap.org/soap/envelope/');
XmlNamespaceManager.AddNamespace('','http://tempuri.org/');
XmlNamespaceManager.AddNamespace('a','http://schemas.datacontract.org/2004/07/Scalepoint.Web.EasyClaims.Webservices.DealerManagement');
XmlNamespaceManager.AddNamespace('i','http://www.w3.org/2001/XMLSchema-instance');
and then I want to do a:
//Find ResponseCode
XmlCurrNode := XmlDocument.SelectSingleNode('s:Envelope/s:Body/SendOrderResponse/SendOrderResult/a:ResultCode', XmlNamespaceManager);
Doing a SelectSingleNode on just 's:Body' works, as does selecting 's:Envelope/s:Body'.
But as soon as I go to the SendOrderResponse my Node is uninitialized
I suspect I'm using/declaring the manager incorrectly, so any pointers would be welcome.
Sending and collecting the response goes fine, but when trying to handle the response, I'm stomped by a blank namespace declaration
The responsexml I get is:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<SendOrderResponse xmlns="http://tempuri.org/">
<SendOrderResult xmlns:a="http://schemas.datacontract.org/2004/07/Scalepoint.Web.EasyClaims.Webservices.DealerManagement" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:Description>...</a:Description>
<a:ResultCode>SCHEMA_VALIDATION_ERROR</a:ResultCode>
<a:ResultDetails i:nil="true"/>
</SendOrderResult>
</SendOrderResponse>
</s:Body>
</s:Envelope>
To handle this I have:
// Create NameSpacemanager
XmlNamespaceManager := XmlNamespaceManager.XmlNamespaceManager(XmlDocument.NameTable);
XmlNamespaceManager.AddNamespace('s','http://schemas.xmlsoap.org/soap/envelope/');
XmlNamespaceManager.AddNamespace('','http://tempuri.org/');
XmlNamespaceManager.AddNamespace('a','http://schemas.datacontract.org/2004/07/Scalepoint.Web.EasyClaims.Webservices.DealerManagement');
XmlNamespaceManager.AddNamespace('i','http://www.w3.org/2001/XMLSchema-instance');
and then I want to do a:
//Find ResponseCode
XmlCurrNode := XmlDocument.SelectSingleNode('s:Envelope/s:Body/SendOrderResponse/SendOrderResult/a:ResultCode', XmlNamespaceManager);
Doing a SelectSingleNode on just 's:Body' works, as does selecting 's:Envelope/s:Body'.
But as soon as I go to the SendOrderResponse my Node is uninitialized
I suspect I'm using/declaring the manager incorrectly, so any pointers would be welcome.