I'm currently facing an XML Parsing issue right on the xml declaration (<?xml ...) with using SOAP::Lite.
not well-formed (invalid token) at line 1, column 3, byte 3 at /usr/lib64/perl5/vendor_perl/XML/Parser.pm line 187.Context: using SOAP::Lite as client to request a service endpoint (WSDL web service) with WSSE security.
URI is not provided as an attribute for method (getListOfSesms) Use of uninitialized value $name in substitution (s///) at /usr/local/ +share/perl5/SOAP/Lite.pm line 1117. Use of uninitialized value $name in exists at /usr/local/share/perl5/S +OAP/Lite.pm line 1118. Use of uninitialized value $name in hash element at /usr/local/share/p +erl5/SOAP/Lite.pm line 1118. Use of uninitialized value $name in hash element at /usr/local/share/p +erl5/SOAP/Lite.pm line 1122. Use of uninitialized value $name in hash element at /usr/local/share/p +erl5/SOAP/Lite.pm line 1122. SOAP::Transport::HTTP::Client::send_receive: POST https://A.B.C.D:8443 +/prov/services/ConfigAdminService HTTP/1.1 Accept: text/xml Accept: multipart/* Accept: application/soap Content-Length: 1384 Content-Type: text/xml; charset=utf-8 SOAPAction: "#getListOfSesms" <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:con="config.ws.nortelnetworks.com" xmlns:namesp1="http://namespaces.soaplite.com/perl" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Header> <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs. +oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd +" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss- +wssecurity-utility-1.0.xsd"> <wsse:UsernameToken wsu:Id="UsernameToken-B2BC1A8DAD33A413E21488 +9629128004"> <wsse:Username>XXXXXX</wsse:Username> <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oa +sis-200401-wss-username-token-profile-1.0#PasswordText">XXXXXX</wsse: +Password> <wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/ +01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">YSB2YWx1Z +SBvZiA2OA==</wsse:Nonce> <wsu:Created>2017-03-10T09:12:51Z</wsu:Created> </wsse:UsernameToken> </wsse:Security> </soapenv:Header> <soapenv:Body> <getListOfSesms soapenv:encodingStyle="http://schemas.xmlsoap.org/ +soap/encoding/" xsi:nil="true" /> </soapenv:Body> </soapenv:Envelope> SOAP::Transport::HTTP::Client::send_receive: 500 Can't connect to A.B. +C.D:8443 Content-Type: text/plain Client-Date: Fri, 10 Mar 2017 09:12:51 GMT Client-Warning: Internal response Can't connect to A.B.C.D:8443 not well-formed (invalid token) at line 1, column 3, byte 3 at /usr/li +b64/perl5/vendor_perl/XML/Parser.pm line 187. Can't connect to A.B.C.D:8443
For information:
- XML syntax from the trace above has been checked ok with some XML syntax tools
- I have used stubmaker to get WSDL into Perl (ConfigAdminIFService here)
- I had to use call() instead of method() to pass the authentication parameters ($auth)
- when using SOAPUI, there is no xml declaration in the request.
Some code extracts:
use strict; use utf8; use XML::Parser; use Time::Local; use Digest::SHA1; use MIME::Base64; use SOAP::Lite +trace => 'debug', readable => 1; use SOAP::WSDL; use ConfigAdminIFService; $SOAP::Constants::PREFIX_ENV = 'soapenv'; [...] my $service_url='https://A.B.C.D:8443/prov/services/ConfigAdminService +'; my $soap = new ConfigAdminIFService->new(); $soap->proxy($service_url); $soap->serializer->attr({ "xmlns:con" => "config.ws.nortelnetworks.com +" , "xmlns:soapenv" => "http://schemas.xmlsoap.org/soap/envelope/" }) +; $soap->readable(1); my $response = $soap->call( SOAP::Data ->name('getListOfSesms') ->attr({ "soapenv:encodingStyle" => "http://sc +hemas.xmlsoap.org/soap/encoding/" }), $auth);
I have run through various settings, including encoding, Content-Type, etc. without luck so far.
Also, would there be any option for removing the xml declaration as it is not present in the raw request when using SOAPUI ?
Thanks a lot for your previous help and advice
Erwan.
In reply to XML Parsing issue with SOAP::Lite (xml declaration) by erwanhumez
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |