Forum Discussion

joshuajburris's avatar
joshuajburris
New Contributor
8 years ago

Scripting Options for SOAP/XML requests

Hello, any advice or help with this issue would be GREATLY appreciated.

 

What do you all recommend for scripting SOAP requests. This is my connection with my test Cisco Call Manager. I can build the new trunk just fine using SOAP UI but am in need of a standalone method using HTML or VBS. My programming language is limited to most VB and Visual Studio. I just need a way to process a large number of SOAP envelopes based on entries in something like a Windows Form application.

Sorry if I posted this in the wrong place.

POST https://192.168.0.29:8443/axl/ HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "CUCM:DB ver=10.5 addSipTrunk"
Content-Length: 1721
Host: 192.168.0.29:8443
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
Authorization: Basic Z2RhZG1pbjpHZW5EeW4xMiMk

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/10.5">
   <soapenv:Header/>
   <soapenv:Body>
      <ns:addSipTrunk>
         <sipTrunk>
            <name>TEST_TRUNK</name>
            <!--Optional:-->
            <description>TEST_TRUNK</description>
            <product>SIP Trunk</product>
            <class>Trunk</class>
            <protocol>SIP</protocol>
            <protocolSide>Network</protocolSide>
            <devicePoolName>G.711 Device Pool</devicePoolName>
            <networkLocation>Use System Default</networkLocation>
            <mlppDomainId>-1</mlppDomainId>
            <mlppIndicationStatus>Off</mlppIndicationStatus>
            <preemption>Disabled</preemption>
            <useTrustedRelayPoint>Default</useTrustedRelayPoint>
            <retryVideoCallAsAudio>true</retryVideoCallAsAudio>
            <securityProfileName>Non Secure SIP Trunk Profile</securityProfileName>
            <sipProfileName>Standard SIP Profile</sipProfileName>
            <transmitUtf8>false</transmitUtf8>
            <sigDigits>99</sigDigits>
            <destinations>
               <destination>
                  <addressIpv4>155.30.180.29</addressIpv4>
                  <port>5060</port>
                  <sortOrder>1</sortOrder>
               </destination>
            </destinations>
            <pathReplacementSupport>false</pathReplacementSupport>
            <trunkTrafficSecure>When using both sRTP and TLS</trunkTrafficSecure>
            <callingAndCalledPartyInfoFormat>Deliver DN only in connected party</callingAndCalledPartyInfoFormat>
         </sipTrunk>
      </ns:addSipTrunk>
   </soapenv:Body>
</soapenv:Envelope>

3 Replies

  • KarelHusa's avatar
    KarelHusa
    Champion Level 3

    If you need to test web services, SoapUI is a good choice. You can execute the requests both in UI and from command line.

     

    If you need to execute batch script which prepares requests and consumes web services I recommend to stay with your preferred programming language (e.g. VBS) and use either its libraries or external tools like curl to consume SOAP services.

     

    Karel

     

  • nmrao's avatar
    nmrao
    Champion Level 3
    If you want to use SoapUI, the groovy( java) is best pair.

    Groovy is so simple you can equip your self easily. You already said familiar with some scripting, just syntax or grammer would change, nothing more.

    May be you can have a look below post and suggested links to get familiar. We have a great community here and other QA sites where there are lot of people willing help the needy ones.

    https://community.smartbear.com/t5/SoapUI-Open-Source/How-to-read-and-use-SoapUI-API-for-non-Dev-people/m-p/108191/highlight/true#M18642

    Having said that, again you are free to choose your favorite tools.
    • joshuajburris's avatar
      joshuajburris
      New Contributor

      Awesome, thank you for the info. I will check out the SOAP UI and Groovy option. SOAP UI was indispensable in testing each of the SOAP functions on the call manager (e.g. addSipTrunk or updateCallManager).

       

       

      I did manage to make a little progress using Powershell scripts and the invoke-webrequest methods. Assembling the Base64 authorization header gave me some trouble, but I think I have that figured out now too.

      Now I have to see what I'll need to do about running all of these **bleep** scripts :)

      What a great community so far!