Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SOAP request from Linux CLI

Posted on 2014-03-10
4
Medium Priority
?
875 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 33

Accepted Solution

by:
shalomc earned 1500 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

New Relic recently released its Synthetics product that allows for the creation of performance monitors that periodically test a site's performance. If you wish to test an interactive workflow New Relic employs Selenium WebDriverJS to run those test…
Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
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…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

715 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