Solved

SOAP request from Linux CLI

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Specific format 21 207
MS SQL Database Generating XML using query 21 50
Wordpress Hacked 1 49
How does proportional-column-width work in xsl fo 4 14
The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

830 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