Extract Policy to extract from the SOAP message

abiram8
Participant IV

My request with POST with Content-Type and application/xml looks like below

Extract Policy sits in request and Assign Policy in response. This deploys without any error

SOAP request:

<?xml version="1.0" encoding="utf-8"?>

<soapxx:Envelope xmlns:xsi="http://www.ee.net/200/XMLSchema-instance"

xmlns:xsd="http:// www.ee.net/200/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-env">

<soapxx:Header>

<XXXSOAPInfo xmlns="https://cs.world.net/">

<Info>requireInfo</info>

<text>textInfo</text>

< soapxx:Header>

</soapxx:Header>

<soapxx:Body>

<getDynLinks xmlns="https://cs.world.com/">

<pid>string</pid>

</getDynLinks>

</soapxx:Body>

</soapxx:Envelope>

Extract Policy with XPath looks like below.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<ExtractVariables async="false" continueOnError="false" enabled="true" name="Extract-Method">

<DisplayName>Extract Method</DisplayName>

<Source>request</Source>

<VariablePrefix>getSOAPHeaderName</VariablePrefix>

<XMLPayload stopPayloadProcessing="false">

<Namespaces>

<Namespace prefix="soapxx"> http://www.w3.org/2003/05/soap-env </Namespace>

</Namespaces>

<Variable name="soapMethod" type="nodeset">

<XPath>/soapxx:Envelope/soapxx:Header/XXXSOAPInfo/Info</XPath>

</Variable>

</XMLPayload>

</ExtractVariables>

Even replaced nodeset with string the value was still empty.

First I wanted to get the string value from info to chk the validity of XPath

Even tried

/soapxx:Envelope/soapxx:Header/XXXSOAPInfo/Info/text() as XPATH

But the value which assign returns till empty string.. in Assign Policy

My overall view is to find the SOAP Header info if the SOAP Header is coming with

XXXSOAPInfo invoke a SOAP Method else different then invoke another SOAP Method

Please guide if I am missing in XPATH ? or any other suggestion in handling such flow what kind of policy for E2E execution to be used if not correctly implemented..

0 2 1,119
2 REPLIES 2

It is hard to read the xml and policy, nevertheless to begin with you are failing to declare the prefix of your namespaces, they should be:

<XMLPayload stopPayloadProcessing="false">
    <Namespaces>
        <Namespace prefix="soapxx">http://www.w3.org/2003/05/soap-env</Namespaces>
    </Namespaces>
    <Variable name="soapMethod" type="string">
        <XPath>/soapxx:Envelope/soapxx:Header/XXXSOAPInfo/Info</XPath>
    </Variable>
</XMLPayload>

abiram8
Participant IV

Thanks @isaias arellano degade for your inputs.

I tried this option as well, but it did not work.

Finally I took the required WSDL and created the proxy in API which created the Extract with required XPath logic and other policy in the Edge.

I reused those logic and Policy to required flow which worked for me.