Sponsored Content
Top Forums Web Development Error on executing soap request using Curl command Post 302956314 by siramitsharma on Tuesday 29th of September 2015 01:51:31 AM
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>

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

error while executing the mail command

Hi, I am getting an error while executing the mail command.... It says saved letter in dead.letter even though the email id id correct . Please do help.. Madhu (2 Replies)
Discussion started by: madhumathikv
2 Replies

2. UNIX for Advanced & Expert Users

Issue in Curl to send http POST request with attachment/multipart

Hi, I am using curl to hit a url using http in solaris 10 using commandline, I want to transfer an attachment(using multipart curl -F) also as a part of the request. If anyone has used kindly help me with the syntax. I am using below command: Code: /usr/local/bin/curl -v... (1 Reply)
Discussion started by: manishmaha
1 Replies

3. Red Hat

Error while executing isql command on RHEL4

Hi, I am using RHEL4 and Oracle11g , my application requires odbc connection hence I modified ODBC.ini file and when I exceute isql commande I got the following error. isql: error while loading shared libraries: /opt/nastel/apwmq/odbc/lib/libodbc.so.1: requires glibc 2.5 or later dynamic... (1 Reply)
Discussion started by: roopalidalvi231
1 Replies

4. Red Hat

Error while executing isql command on RHEL4

Hi, I am using RHEL4 and Oracle11g , my application requires odbc connection hence I modified ODBC.ini file and when I exceute isql commande I got the following error. isql: error while loading shared libraries: /opt/nastel/apwmq/odbc/lib/libodbc.so.1: requires glibc 2.5 or later dynamic... (4 Replies)
Discussion started by: roopalidalvi231
4 Replies

5. Shell Programming and Scripting

Error while executing sh command

Hi, I have 2 files temp1.sh and temp2.sh as follows: =========== temp1.sh =========== echo "session1" sh temp2.sh echo "exit session2 and enter session1" ================================= ============= temp2.sh ============= echo "session2" sh echo "exit session2"... (5 Replies)
Discussion started by: RP09
5 Replies

6. Solaris

Access Sharepoint site using SOAP request in unix

Hi, We are using a java application (Java 6 , Using JAX-WS 2.0 to Create a Simple Web Service) that accesses SharePoint API through web services. We were able to get the data in windows and do all operations the API allows. When we deploy this application on UNIX environment (Solaris 10)... (0 Replies)
Discussion started by: johninweb
0 Replies

7. UNIX for Advanced & Expert Users

Error executing sqlcmd command through UNIX

Hi All, I am trying to execute a set of sql statements in sql server 2008 using the sqlcmd command in unix and passing the query in the "input" parameter. It is giving me an error "incorrect syntax near 2014". The below statement is giving an error : declare date_val datetime, ... (4 Replies)
Discussion started by: Rahul Raj
4 Replies

8. IP Networking

CurL command Rest API call with oauth 2.0 secutity error

Hi I need to get rates for different security form REST API . the API is oauth 2.0 secured. i need to use curl command to get json response from api . token URL - is HTTP data URL is - HTTPS when trigger my command from bash script it passing and failing intermittently with... (0 Replies)
Discussion started by: shobhit.working
0 Replies

9. Web Development

Curl Command Error

Good afternnon. I need your help please to understand the basics of curl command to test web services. Ive heard i can test a web service using this command,so: curl http://glb_osb_fs.nh.inet:7110/serverglobal/services/StrategicPlanning/NotifyMNPAction_v1 it yields some errors, i would... (5 Replies)
Discussion started by: alexcol
5 Replies
SOAP::WSDL::Client(3pm) 				User Contributed Perl Documentation				   SOAP::WSDL::Client(3pm)

NAME
SOAP::WSDL::Client - SOAP::WSDL's SOAP Client SYNOPSIS
use SOAP::WSDL::Client; my $soap = SOAP::WSDL::Client->new({ proxy => 'http://www.example.org/webservice/test' }); $soap->call( \%method, $body, $header); METHODS
call $soap->call( \%method, @parts ); %method is a hash with the following keys: Name Description ---------------------------------------------------- operation operation name soap_action SOAPAction HTTP header to use style Operation style. One of (document|rpc) use SOAP body encoding. One of (literal|encoded) The style and use keys have no influence yet. @parts is a list containing the elements of the message parts. For backward compatibility, call may also be called as below: $soap->call( $method, @parts ); In this case, $method is the SOAP operation name, and the SOAPAction header is guessed from the first part's namespace and the operation name (which is mostly correct, but may fail). Operation style and body encoding are assumed to be document/literal Configuration methods outputxml $soap->outputxml(1); When set, call() returns the raw XML of the SOAP Envelope. set_content_type $soap->set_content_type('application/xml; charset: utf8'); Sets the content type and character encoding. You probably should not use a character encoding different from utf8: SOAP::WSDL::Client will not convert the request into a different encoding (yet). To leave out the encoding, just set the content type without appending charset like this: $soap->set_content_type('text/xml'); Default: text/xml; charset: utf8 set_prefix $soap->set_prefix('ns2'); If set, alters the serialization of the request XML such that the supplied value is used as a namespace prefix for SOAP method calls. By way of example, the default XML serialization returns something like this: <?xml version="1.0"?> <SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <getElementId xmlns="http://services.exmaple.org/"> <elementId>12345</elementId> </getElementId> </SOAP-ENV:Body> </SOAP-ENV:Envelope> If the sample set_prefix() call above is used prior to calling your SOAP method, the XML serialization returns this instead: <?xml version="1.0"?> <SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http://services.example.org/"> <SOAP-ENV:Body> <ns2:getElementId> <elementId>12345</elementId> </ns2:getElementId> </SOAP-ENV:Body> </SOAP-ENV:Envelope> This is useful in cases where, for instance, one is communicating with a JAX <https://jax-ws.dev.java.net/> webservice, which tends to understand the latter but not the former. Note that this implementation is currently limited to a single additional namespace; if you require multiple custom namespaces, you should probably look into creating your own serializer. Features different from SOAP::Lite SOAP::WSDL does not aim to be a complete replacement for SOAP::Lite - the SOAP::Lite module has its strengths and weaknesses and SOAP::WSDL is designed as a cure for the weakness of little WSDL support - nothing more, nothing less. Nonetheless SOAP::WSDL mimics part of SOAP::Lite's API and behaviour, so SOAP::Lite users can switch without looking up every method call in the documentation. A few things are quite different from SOAP::Lite, though: SOAP request data SOAP request data may either be given as message object, or as a hash ref (in which case it will automatically be encoded into a message object). Return values The result from call() is not a SOAP::SOM object, but a message object. Message objects' classes may be generated from WSDL definitions automatically - see SOAP::WSDL::Generator::Typelib on how to generate your own WSDL based message class library. Fault handling SOAP::WSDL::Client returns a fault object on errors, even on transport layer errors. The fault object is a SOAP1.1 fault object of the following "SOAP::WSDL::SOAP::Typelib::Fault11". SOAP::WSDL::SOAP::Typelib::Fault11 objects are false in boolean context, so you can just do something like: my $result = $soap->call($method, $data); if ($result) { # handle result } else { die $result->faultstring(); } outputxml SOAP::Lite returns only the content of the SOAP body when outputxml is set to true. SOAP::WSDL::Client returns the complete XML response. Auto-Dispatching SOAP::WSDL::Client does not support auto-dispatching. This is on purpose: You may easily create interface classes by using SOAP::WSDL::Client and implementing something like sub mySoapMethod { my $self = shift; $soap_wsdl_client->call( mySoapMethod, @_); } You may even do this in a class factory - see wsdl2perl for creating such interfaces. TROUBLESHOOTING
Accessing protected web services Accessing protected web services is very specific for the transport backend used. In general, you may pass additional arguments to the set_proxy method (or a list ref of the web service address and any additional arguments to the new method's proxy argument). Refer to the appropriate transport module for documentation. LICENSE AND COPYRIGHT
Copyright 2004-2007 Martin Kutter. This file is part of SOAP-WSDL. You may distribute/modify it under the same terms as perl itself AUTHOR
Martin Kutter <martin.kutter fen-net.de> REPOSITORY INFORMATION
$Rev: 851 $ $LastChangedBy: kutterma $ $Id: Client.pm 851 2009-05-15 22:45:18Z kutterma $ $HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Client.pm $ perl v5.10.1 2010-12-21 SOAP::WSDL::Client(3pm)
All times are GMT -4. The time now is 02:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy