Extract a element from soap request using extractvariable policy or javascript

Not applicable

Hi I would like to extract Firstname from soap request using extractvariable policy or Javascript callout policy please help

Solved Solved
0 4 1,101
1 ACCEPTED SOLUTION

Not applicable

I found answer hope it will help others....

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ExtractVariables name="Extract-CustomerAccNo"> <DisplayName>Extract AccNo</DisplayName> <Properties/> <Source clearPayload="false">request</Source> <XMLPayload stopPayloadProcessing="false"> <Namespaces> <Namespace prefix="soapenv">http://schemas.xmlsoap.org/soap/envelope/</Namespace> <Namespace prefix="ns2">http://xmlns.oracle.com/apps/mdm/customer</Namespace> <Namespace prefix="xmlns">http://www.t-mobile.com/u2/xml/SwiPersonIO</Namespace> </Namespaces> <Variable type="string" name="ABC"> <XPath>/soapenv:Envelope/soapenv:Body/ns2:updatePerson_Input/xmlns:ListOfSwiPersonIO/xmlns:Contact/xmlns:FirstName</XPath> </Variable> </XMLPayload> </ExtractVariables>

View solution in original post

4 REPLIES 4

Not applicable

I have tried this policy but it fails

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ExtractVariables async="false" continueOnError="false" enabled="true" name="ExtractXMLStuff"> <DisplayName>ExtractXMLStuff</DisplayName> <Source>request</Source> <XMLPayload> <Variable name="ABC" > <XPath>/*[local-name()='Envelope']/*[local-name()='Body']/*[local-name()='updatePerson_Input']/*[local-name()='ListOfSwiPersonIO']/*[local-name()='Contact']/*[local-name()='FirstName']</XPath> </Variable> </XMLPayload> </ExtractVariables>

Not applicable

I have tried js policy this also didnt give proper response

var xmlObj = request.content.asXML; var S = new Namespace('http://schemas.xmlsoap.org/soap/envelope/'); var ns1 = new Namespace('http://www.t-mobile.com/u2/xml/SwiPersonIO'); var value1 = xmlObj.S::Body.ns1::updatePerson_Input.ns1::ListOfSwiPersonIO.ns1::Contact.ns1::FirstName.toString();; context.setVariable("name",value1);

Not applicable

SOAP request from which firstname to be extracted. Someone please help

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:fico="http://www.fico.com"> <soapenv:Header/> <soapenv:Body> <ns2:updatePerson_Input xmlns="http://www.t-mobile.com/u2/xml/SwiPersonIO" xmlns:ns2="http://xmlns.oracle.com/apps/mdm/customer"> <ListOfSwiPersonIO ExternalSystemId="SAP-CARE"> <Contact operation="Upsert"> <Id>b04ae1b3-d75a-4e49-8d06-a5d2bbc0564e</Id> <FirstName>ASSC</FirstName> <LastName>MMMN</LastName> <MiddleName>NBB</MiddleName> <BirthDate>01/31/1960</BirthDate> <EmailAddress>jaqa.bv87h66@ymail.com</EmailAddress> <MobilePhoneNumber>8987898786</MobilePhoneNumber> <SocialSecurityNumber>000555171</SocialSecurityNumber> <PIN>1234</PIN> <ListOfPersonalAddress> <PersonalAddress IsPrimaryMVG="Y"> <INSPersonalStreetAddress>3545 FACTORIA BLVD SE</INSPersonalStreetAddress> <INSPersonalCity>BELLEVUE</INSPersonalCity> <INSPersonalState>WA</INSPersonalState> <INSPersonalPostalCode>98006</INSPersonalPostalCode> </PersonalAddress> </ListOfPersonalAddress> <ListOfCIFContactReference/> <ListofContactIdInfo> <ContactIdInfo> <IDType>DL</IDType> <IDNum>Hguu87876</IDNum> <IDState>WA</IDState> </ContactIdInfo> </ListofContactIdInfo> </Contact> </ListOfSwiPersonIO> </ns2:updatePerson_Input> </soapenv:Body> </soapenv:Envelope>

Not applicable

I found answer hope it will help others....

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ExtractVariables name="Extract-CustomerAccNo"> <DisplayName>Extract AccNo</DisplayName> <Properties/> <Source clearPayload="false">request</Source> <XMLPayload stopPayloadProcessing="false"> <Namespaces> <Namespace prefix="soapenv">http://schemas.xmlsoap.org/soap/envelope/</Namespace> <Namespace prefix="ns2">http://xmlns.oracle.com/apps/mdm/customer</Namespace> <Namespace prefix="xmlns">http://www.t-mobile.com/u2/xml/SwiPersonIO</Namespace> </Namespaces> <Variable type="string" name="ABC"> <XPath>/soapenv:Envelope/soapenv:Body/ns2:updatePerson_Input/xmlns:ListOfSwiPersonIO/xmlns:Contact/xmlns:FirstName</XPath> </Variable> </XMLPayload> </ExtractVariables>