Search code examples
postmansoapui

How to sent information for creating e.g service via input txt file in Postman/SOAPUI POST request


I have a network product which provides us the REST API to get/create/modify different services but according the vendor document while creating a service there are number of parameters we need to sent in the curl request as input file.

Here is the sample curl request based on their document:

curl -X POST –u jsmith:password –d @input.txt -k https://192.0.2.1:8443/ng1api/ncm/services -H “Content-Type:application/xml”

Now my question how can i run the POST request with the input.txt using the Postman or SOAP UI .

I have a input in XML (contents of input.txt)

<services>

    <serviceDetail>

        <serviceType>1</serviceType>

        <alertProfileID>1</alertProfileID>

        <isAlarmEnabled>false</isAlarmEnabled>

        <serviceMembers>

             <enableAlert>false</enableAlert>

             <locationKeyInfo>

                 <isLocationKey>true</isLocationKey>

                 <keyType>10</keyType>

                 <keyAttr>0</keyAttr>

                 <asi1xType>VLAN</asi1xType>

             </locationKeyInfo>

             <protocolOrGroupCode>POP2</protocolOrGroupCode>

             <meAlias>myProbe:if4</meAlias>
        </serviceMembers>

      <id>-1</id>

      <serviceName>testApp1</serviceName>

    </serviceDetail>

</services>

Thanks

Sina


Solution

  • Your request appears to be fairly basic, and should be fairly straight forward to create in Postman.

    You just need to set the body to raw\XML and then paste the XML into the body.

    enter image description here

    As soon as you set the body to raw\XML, it will add the Content-Type:application/xml header.

    For the authorization, click on the Authorization tab and enter your details there.

    If you are new to Postman, I would recommend a trip to their Learning Centre to get used to the application features.