Search code examples
xmlvariablessoaprequestpostman

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.


Solution

  • 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>