Layer7 API Management

  • 1.  Modify SOAP Request

    Posted Apr 17, 2017 12:48 AM

    Hi,

     

    I want to replace a value in SOAP Envelope.

    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
    <soap:Header>
    <h:oauth xmlns="http://token.com"
    xmlns:h="http://sampleurl.com">abcd1234</h:oauth>
    </soap:Header>
    <soap:Body>
    <RetrieveRequestMsg xmlns="http://sampleurl.com/wsdl/partnerAPI">
    <RetrieveRequest>
    <Properties>id</Properties>
    <Filter xsi:type="SimpleFilterPart">
    <Property>name</Property>
    <SimpleOperator>equals</SimpleOperator>
    <Value>Ravish</Value>
    </Filter>
    </RetrieveRequest>
    </soap:Body>
    </soap:Envelope>

     

    I want to replace oauth value "abcd1234" to "pink9876" at runtime that is saved in other context variable "cv_oauth". And, I also want to replace "Ravish" value to "Kumar" that is also saved in some other context variable "cv_name".

     

    Can you please help me to modify SOAP Request message.

     

    Thanks,

    Ravish



  • 2.  Re: Modify SOAP Request
    Best Answer

    Broadcom Employee
    Posted Apr 18, 2017 09:19 AM

    Hi,

     

    have you tried the Evaluate Request XPath Assertion? Please check:

    Evaluate Request XPath Assertion - CA API Gateway - 9.2 - CA Technologies Documentation 

     

    It should help you to identify the Element. Thereafter you may use the Add or Remove XML Element(s) Assertion to replace the value:

    Add or Remove XML Element(s) Assertion - CA API Gateway - 9.2 - CA Technologies Documentation 

     

    Cheers,

    HD