Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

POSTMAN set variable within a XML request Body

I'm trying to make SOAP request with xml using postman, but some of the parameters I want to send must be environment variables I have already stored in other request.

The request Body is something like that:

<soapenv:Envelope xmlns:soapenv="blablabla" xmlns:XXX="http:blablabla/">
    <soapenv:Header/>
    <soapenv:Body>
        <XXX:Function>
            <CODE>878734ijHgs</CODE>
            <DISTRIBUTOR>myDistributor</DISTRIBUTOR>
            <MAGICNUMBER>21</MAGICNUMBER>
        </XXX:Function>
    </soapenv:Body>
</soapenv:Envelope>

The point is that as MAGICNUMBER I would like to send a value that I have previously stored as a environment variable, but the syntax {{variable}} doesn't work with XML

Please suggest.

like image 329
Gabriel García Garrido Avatar asked May 11 '26 22:05

Gabriel García Garrido


1 Answers

I found the solution. Example:

<soapenv:Envelope xmlns:soapenv="blablabla" xmlns:XXX="http:blablabla/">
    <soapenv:Header/>
    <soapenv:Body>
        <XXX:Function>
            <CODE>878734ijHgs</CODE>
            <DISTRIBUTOR>myDistributor</DISTRIBUTOR>
            <MAGICNUMBER>{{variable}}</MAGICNUMBER>
        </XXX:Function>
    </soapenv:Body>
</soapenv:Envelope>
like image 85
Gabriel García Garrido Avatar answered May 14 '26 16:05

Gabriel García Garrido



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!