Error on executing soap request using Curl command

Tags
web

Login to Reply

 
Thread Tools Search this Thread
# 1  
Old 09-29-2015
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>

# 2  
Old 09-29-2015
Since your data contains no - , it must be complaining about your headers.
# 3  
Old 09-29-2015
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

This User Gave Thanks to cjcox For This Post:
Corona688 (09-29-2015)
Login to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Similar Threads More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
CurL command Rest API call with oauth 2.0 secutity error shobhit.working IP Networking 0 05-14-2018 06:53 AM
Error executing sqlcmd command through UNIX Rahul Raj UNIX for Advanced & Expert Users 4 06-22-2015 10:34 AM
Curl command rakeshtomar82 Shell Programming and Scripting 1 04-09-2015 08:15 AM
Access Sharepoint site using SOAP request in unix johninweb Solaris 0 07-23-2012 11:19 PM
Error while executing sh command RP09 Shell Programming and Scripting 5 07-02-2012 03:56 AM
Error while executing isql command on RHEL4 roopalidalvi231 Red Hat 4 04-13-2012 05:17 AM
Error while executing isql command on RHEL4 roopalidalvi231 Red Hat 1 04-13-2012 12:55 AM
Perl / SOAP error 'code=501' aixlover Shell Programming and Scripting 0 02-03-2012 11:17 AM
SFTP-how to log individual sftp command error while executing shell script noobrobot Shell Programming and Scripting 1 10-09-2011 08:17 PM
Error while executing command in aix box newtoaixos AIX 6 08-18-2011 07:22 AM
Issue in Curl to send http POST request with attachment/multipart manishmaha UNIX for Advanced & Expert Users 1 05-19-2010 02:12 AM
Error executing shell command from a perl script voorkey Shell Programming and Scripting 5 03-30-2009 08:48 AM
Soap Server error sophos UNIX for Advanced & Expert Users 0 02-09-2009 06:41 PM
error while executing the mail command madhumathikv Shell Programming and Scripting 2 02-17-2008 09:43 AM
All times are GMT -4. The time now is 06:52 PM.

Unix & Linux Forums Content Copyright 1993-2018. All Rights Reserved.
UNIX.COM Login
Username:
Password:  
Show Password





Not a Forum Member?
Forgot Password?