Hi,
I am trying to extract url in extract variable policy from soap request . Below is xpath :
<XPath>/soapenv:Envelope/soapenv:Header/sf:SessionHeader/sf:serverUrl/text()</XPath>
When I try to deploy the API , it throws below error .
Xpath is validated online. It returns url which am trying to extract.
Error Deploying
ExtractVariables Extract-Variables: Failed to compile xpath /soapenv:Envelope/soapenv:Header/sf:SessionHeader/sf:serverUrl/text(). Context Revision:1;APIProxy:hedgerxconnectservice;Organization:sp3rheldirrc1;Environment:test
Thanks,
Suma
Solved! Go to Solution.
Hi, @Sumacv
For help with your specific case, can you please post the SOAP message and the full XPath policy configuration you are using (including the part where you specify the namespaces).
"Failed to compile xpath" suggests that you are using a namespace prefix in the XPath string that you have not previously "registered" with a Namespace declaration. Normally it would look something like this:
<ExtractVariables name='Extract-Response'> <VariablePrefix>result</VariablePrefix> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> <XMLPayload> <Namespaces> <Namespace prefix='soap'>http://schemas.xmlsoap.org/soap/envelope/</Namespace> <Namespace prefix='ns1'>http://www.w3schools.com/xml/</Namespace> </Namespaces> <Variable name='fvalue' type='string'> <XPath>/soap:Envelope/soap:Body/ns1:CelsiusToFahrenheitResponse/ns1:CelsiusToFahrenheitResult/text()</XPath> </Variable> <Variable name='cvalue' type='string'> <XPath>/soap:Envelope/soap:Body/ns1:FahrenheitToCelsiusResponse/ns1:FahrenheitToCelsiusResult/text()</XPath> </Variable> </XMLPayload> </ExtractVariables>