Solved

SOAP request from Linux CLI

Posted on 2014-03-10
4
819 Views
Last Modified: 2016-02-26
Hi,

I am currently trying to use a SOAP service to access my Cisco Call Manager via AXL. However I want to do this from Linux CLI. If I use SoapUI I can use the soap.xsd and api.wsdl to get it working, however I want to get it working from Linux CLI.

The SOAP XML from SoapUI looks like this

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/8.5">
   <soapenv:Header/>
   <soapenv:Body>
      <ns:listRoutePlan sequence="?">
         <searchCriteria>
           
            <partition>Extensions</partition>
           
         </searchCriteria>
         <returnedTags uuid="?">
            <!--Optional:-->
            <dnOrPattern>?</dnOrPattern>
            <!--Optional:-->
            <partition uuid="?">?</partition>
            <!--Optional:-->
            <type>?</type>
            <!--Optional:-->
            <routeDetail>?</routeDetail>
         </returnedTags>
       
      </ns:listRoutePlan>
   </soapenv:Body>
</soapenv:Envelope>


and the RAW data looks like

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

I have tried a whole heap of googling and trying different cURL options and just can't get it to work.

My goal is to query the Server and get an output back with what I have requested and save to a txt file.

How can I complete this?

Thanks in advance!
0
Comment
Question by:mark_06
  • 3
4 Comments
 
LVL 33

Accepted Solution

by:
shalomc earned 500 total points
ID: 39921883
Using curl:

Save the XML into a file called my_request.xml

curl --request POST
  --header "SOAPAction: CUCM:DB ver=8.5 listRoutePlan"
  --header "Content-type: text/xml;charset=UTF-8"
  --header "User-Agent: Apache-HttpClient/4.1.1 (java 1.5)"
  --header "Authorization: Basic YXhsOk5pZW"
  --data @my_request.xml -o response.txt "https://192.168.1.245:8443/axl/"
0
 
LVL 6

Author Comment

by:mark_06
ID: 39922345
Thanks for that, I get a response now but still not working...

I get this in the output file
"Unexpected EOF in prolog at [row,col {unknown-source}]: [1,0]"
What could cause this?
0
 
LVL 6

Author Comment

by:mark_06
ID: 39922354
This is my request file

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://localhost/">
   <soapenv:Header/>
   <soapenv:Body>
      <ns:listRoutePlan sequence="?">
         <searchCriteria>
           
            <partition>Extensions</partition>
           
         </searchCriteria>
         <returnedTags uuid="?">
            <!--Optional:-->
            <dnOrPattern>?</dnOrPattern>
            <!--Optional:-->
            <partition uuid="?">?</partition>
            <!--Optional:-->
            <type>?</type>
            <!--Optional:-->
            <routeDetail>?</routeDetail>
         </returnedTags>
       
      </ns:listRoutePlan>
   </soapenv:Body>
</soapenv:Envelope>

I have the wsdl and xsd files sitting here "http://localhost/"
0
 
LVL 6

Author Closing Comment

by:mark_06
ID: 39950185
Just had to tweak it a bit but worked thanks
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I made this because I wanted to get e-mail with a attached csv file so I'd would be able to import user input into a MS Excel template, but I also wanted to register/save all inputs from each day in a file on the server. 1st - It creates a temp C…
In this article you will learn how to create a free basic website on Bitbucket, a git service provider. Polymer creates dynamic HTML components, which allow more flexibility than static HTML. This tutorial uses Ubuntu Linux but can also be done on W…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question