Home Man
Search
Today's Posts
Register

Javascript, Javascript libs and toolkits, LAMP, Apache, MySQL, HTML, and other web coding posts.

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

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

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 05:53 AM
Error executing sqlcmd command through UNIX Rahul Raj UNIX for Advanced & Expert Users 4 06-22-2015 09:34 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
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 while executing the mail command madhumathikv Shell Programming and Scripting 2 02-17-2008 08:43 AM


All times are GMT -4. The time now is 05:21 AM.

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