Error on executing soap request using Curl command


Login or Register 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>

# 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 or Register to Reply

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

More UNIX and Linux Forum Topics You Might Find Helpful
CurL command Rest API call with oauth 2.0 secutity error shobhit.working IP Networking 0 05-14-2018 05:53 AM
Error executing sqlcmd command through UNIX Rahul Raj UNIX for Advanced & Expert Users 4 06-22-2015 09:34 AM
Curl command rakeshtomar82 Shell Programming and Scripting 1 04-09-2015 07:15 AM
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
Error while executing isql command on RHEL4 roopalidalvi231 Red Hat 4 04-13-2012 04:17 AM
Error while executing isql command on RHEL4 roopalidalvi231 Red Hat 1 04-12-2012 11:55 PM
Perl / SOAP error 'code=501' aixlover Shell Programming and Scripting 0 02-03-2012 10:17 AM
SFTP-how to log individual sftp command error while executing shell script noobrobot Shell Programming and Scripting 1 10-09-2011 07:17 PM
Error while executing command in aix box newtoaixos AIX 6 08-18-2011 06:22 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
Error executing shell command from a perl script voorkey Shell Programming and Scripting 5 03-30-2009 07:48 AM
Soap Server error sophos UNIX for Advanced & Expert Users 0 02-09-2009 05:41 PM
error while executing the mail command madhumathikv Shell Programming and Scripting 2 02-17-2008 08:43 AM