Unix/Linux Go Back    


Web Programming Discuss Web Programming and Web Server Administration, including LAMP, Apache, MySQL, HTML, SEO, and other Web APIs and topics.

Error on executing soap request using Curl command

Web Programming


Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 09-29-2015   -   Original Discussion by siramitsharma
siramitsharma's Unix or Linux Image
siramitsharma siramitsharma is offline
Registered User
 
Join Date: Mar 2012
Last Activity: 26 July 2017, 2:30 AM EDT
Posts: 100
Thanks: 22
Thanked 0 Times in 0 Posts
Error on executing soap request using Curl command

hi,
i have curl command to POST a soap request to web service. I have a file (query.xml) which has all the soap message attached to it I just don't seem to be able to properly post it.

curl command


Code:
curl -s -H "Content-Type: text/soap+xml;charset=UTF-8" -H "SOAPAction:" -d @query.xml http://10.130.9.79:7782/services/CBSInterfaceBusinessMgrService

query.xml


Code:
<q2:QueryBasicInfoRequestMsg
        xmlns:q0="http://www.huawei.com/bme/cbsinterface/cbs/businessmgr"
        xmlns:q1="http://www.huawei.com/bme/cbsinterface/common"
        xmlns:q2="http://www.huawei.com/bme/cbsinterface/cbs/businessmgrmsg">
        <parameter name="enableREST">true</parameter>
        <RequestHeader>
                <q1:CommandId>QueryBasicInfo
                </q1:CommandId>
                <q1:Version>1
                </q1:Version>
                <q1:TransactionId/>
                        <q1:SequenceId>1
                        </q1:SequenceId>
                        <q1:RequestType>Event
                        </q1:RequestType>
                        <q1:SerialNo>03020000003
                        </q1:SerialNo>
        </RequestHeader>
<QueryBasicInfoRequest>
<q0:SubscriberNo>9150000014</q0:SubscriberNo> <q0:QueryType>3</q0:QueryType> </QueryBasicInfoRequest> </q2:QueryBasicInfoRequestMsg>

error coming is


Code:
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header>
<wsa:ReplyTo><wsa:Address>http://www.w3.org/2005/08/addressing/none
</wsa:Address>
</wsa:ReplyTo><wsa:MessageID>urn:uuid:AAC81E84BC63EF7AA81443502795856131
</wsa:MessageID><wsa:Action>http://www.w3.org/2005/08/addressing/soap/fault
</wsa:Action>
</soapenv:Header>
<soapenv:Body>
<soapenv:Fault>
<faultcode></faultcode><faultstring>com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '-' (code 45) in prolog; expected '&lt;'
 at [row,col {unknown-source}]: [1,22]</faultstring><detail /></soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>

Sponsored Links
    #2  
Old Unix and Linux 09-29-2015   -   Original Discussion by siramitsharma
Corona688's Unix or Linux Image
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 13 June 2018, 6:37 PM EDT
Location: Saskatchewan
Posts: 22,696
Thanks: 1,183
Thanked 4,334 Times in 3,995 Posts
Since your data contains no - , it must be complaining about your headers.
Sponsored Links
    #3  
Old Unix and Linux 09-29-2015   -   Original Discussion by siramitsharma
cjcox's Unix or Linux Image
cjcox cjcox is offline
Registered User
 
Join Date: May 2005
Last Activity: 27 June 2016, 2:12 PM EDT
Posts: 614
Thanks: 4
Thanked 110 Times in 107 Posts
I usually put my soap requests in a file.... e.g soap-request.txt



Code:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body />
</soapenv:Envelope>

then use curl like so:



Code:
curl -d @soap-request.txt  http://myserver/soapything

The Following User Says Thank You to cjcox For This Useful Post:
Corona688 (09-29-2015)
Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Access Sharepoint site using SOAP request in unix johninweb Solaris 0 07-23-2012 10:19 PM
Error while executing sh command RP09 Shell Programming and Scripting 5 07-02-2012 02:56 AM
Issue in Curl to send http POST request with attachment/multipart manishmaha UNIX for Advanced & Expert Users 1 05-19-2010 01:12 AM



All times are GMT -4. The time now is 09:56 PM.