I have created WSDL file connect the file with PERL soap method. After the exection i get the below error message

"not well-formed (invalid token) at line 1, column 1, byte 1 at /usr/lib/x86_64-linux-gnu/perl5/5.26/XML/Parser.pm line 187." .

Please let me know have to fix the issue.

soap-client.pl
#!/usr/bin/perl -w #use SOAP::Lite +trace => ‘debug’; use SOAP::Lite; my $client = SOAP::Lite ->service('http://localhost/soap/perl/marketplace.wsdl'); my $result = $client->login( 'test_user', 'test_password' ); #~ my $result = $client->sayHello(''); print $result;
soap-server.pl
#!/usr/bin/perl function login( $login, $password ) { return $login; } function doFilter( $params ) { return "some string"; }
marketplace.wsdl
<?xml version="1.0" encoding="UTF-8"?> <definitions name="Marketplace" targetNamespace="urn:Marketplace" xmlns:tns="urn:Marketplace" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/"> <message name="LoginRequest"> <part name="login" type="xsd:string"/> <part name="password" type="xsd:string"/> </message> <message name="LoginResponse"> <part name="result" type="xsd:string"/> </message> <portType name="LoginPort"> <operation name="login"> <input message="tns:LoginRequest"/> <output message="tns:LoginResponse"/> </operation> </portType> <binding name="LoginBinding" type="tns:LoginPort"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.or +g/soap/http"/> <operation name="login"> <soap:operation soapAction="urn:LoginAction"/> <input> <soap:body use="encoded" namespace="urn:Marketplace" e +ncodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body use="encoded" namespace="urn:Marketplace" e +ncodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation> </binding> <service name="WSDLService"> <port name="LoginPort" binding="tns:LoginBinding"> <soap:address location="http://localhost/soap/perl/soap-se +rver.pl"/> </port> </service> </definitions>

finally run the soap-client.pl file return below error message.

"not well-formed (invalid token) at line 1, column 1, byte 1 at /usr/lib/x86_64-linux-gnu/perl5/5.26/XML/Parser.pm line 187." .


In reply to PERL soap not well-formed (invalid token) by kanewilliam7777

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.