in reply to PERL soap not well-formed (invalid token)

SOAP::Lite expects something that looks like XML in the reply, but at least XML::Parser doesn't think that it gets XML back.

Your next step is to look at what exactly comes back from the other end.

You already have a line # use SOAP::Lite +trace => ‘debug’; in your code, but that doesn't match what the SOAP::Trace documentation suggests. Maybe changing that line to the following gives you more output that gives you a hint where things to wrong?

use SOAP::Lite +trace => 'all';

What you are looking for is likely the response from the server. Maybe the server sends an HTML error message, or some JSON or whatever.

Replies are listed 'Best First'.
Re^2: PERL soap not well-formed (invalid token)
by kanewilliam7777 (Novice) on Aug 21, 2018 at 12:21 UTC
    Hi,

    It's sent html error message. Now i have enable the "use SOAP::Lite +trace => "debug";".

    Review full response.

    SOAP::Transport::HTTP::Client::send_receive: POST http://localhost/soa +p/perl/soap-server.pl HTTP/1.1 Accept: text/xml Accept: multipart/* Accept: application/soap Content-Length: 566 Content-Type: text/xml; charset=utf-8 SOAPAction: "urn:LoginAction" <?xml version="1.0" encoding="UTF-8"?><soap:Envelope soap:encodingStyl +e="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://sche +mas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap +.org/soap/encoding/" xmlns:tns="urn:Marketplace" xmlns:wsdl="http://s +chemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema +" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Body><t +ns:login><login xsi:type="xsd:string">test_user</login><password xsi: +type="xsd:string">test_password</password></tns:login></soap:Body></s +oap:Envelope> SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK Connection: close Date: Tue, 21 Aug 2018 12:16:02 GMT Accept-Ranges: bytes ETag: "7c-573f0161015b0" Server: Apache/2.4.29 (Ubuntu) Content-Length: 124 Content-Type: text/x-perl Last-Modified: Tue, 21 Aug 2018 11:11:23 GMT Client-Date: Tue, 21 Aug 2018 12:16:02 GMT Client-Peer: ::1:80 Client-Response-Num: 1 #!/usr/bin/perl sub login( $login, $password ) { return $login; } sub doFilter( $params ) { return "some string"; }

      So, this response means that your web server is not set up correctly and is not running your server Perl script.

      Your next task is to configure your web server so that it runs your Perl script when you go to that URL.

Re^2: PERL soap not well-formed (invalid token)
by Anonymous Monk on Aug 21, 2018 at 11:35 UTC
    Its legit like use SOAP::Lite +trace => 'debug', readable => 1;