Solved

SOAP request from Linux CLI

Posted on 2014-03-10
4
809 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

The Problem How to write an Xquery that works like a SQL outer join, providing placeholders for absent data on the outer side?  I give a bit more background at the end. The situation expressed as relational data Let’s work through this.  I’ve …
For some reason Google Apps has decided to reserve 'www' for your new domain which results in an error when trying to map the web address 'www' to a certain site in your Google Sites. The error is 'this address is already being used' and after some …
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

912 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now