pearlyking has asked for the wisdom of the Perl Monks concerning the following question:

Hi Guys

I'm newish to perl and to this forum but would like this question answered by Guru's only as I have seen some posts clogged-up with hacks that don't understand or read the question

forgive me if that sounds rude

I am using soapUI to access a WSDL page. All works fine!

However, I'm trying to translate the configuration I have into perl but I cannot seem to get pass the authentication.

THE PERL CODE
#!/usr/bin/perl -w use SOAP::Lite +trace => qw( debug ); my $user="perly"; my $password="xxxxx"; $ENV{PERL_LWP_SSL_VERIFY_HOSTNAME}=0; my $soap = SOAP::Lite->service("http://192.168.2.33:8881/ws/datacsv?w +sdl"); #################################### my @headers = ( SOAP::Header->name('Username')->value($user), SOAP::Header->name('Password')->value($password), ); ################################## eval { my $result = $soap->getdata(@headers); }; if ($@) { die $@; } print $om->result(); print "HEADER @headers";

THE OUTPUT

Name "main::om" used only once: possible typo at XML-demo9.pl line 36. SOAP::Transport::HTTP::Client::send_receive: POST ttp://192.168.2.33:8 +881/ws/datacsv HTTP/1.1 Accept: text/xml Accept: multipart/* Accept: application/soap Content-Length: 650 Content-Type: text/xml; charset=utf-8 SOAPAction: "getdata" <?xml version="1.0" encoding="UTF-8"?><soap:Envelope soap:encodingStyl +e="http://schemas.xmlsoap.org/soap/encoding/" xmlns:http="http://sche +mas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/so +ap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding +/" xmlns:t="http://192.168.2.33/ws/stats/types" xmlns:tns="http://192 +.168.2.33/ws/stats" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xml +ns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.or +g/2001/XMLSchema-instance"><soap:Body><tns:getSummary><dataRequest xs +i:nil="true" xsi:type="tns:dataRequest" /></tns:getdata></soap:Body>< +/soap:Envelope> SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 401 Unauthorized Cache-Control: must-revalidate,no-cache,no-store Connection: close Server: Jetty(8.1.7.v20120910) WWW-Authenticate: basic realm="Remote User Access" Content-Length: 1382 Content-Type: text/html;charset=ISO-8859-1 Client-Date: Thu, 05 Apr 2018 13:15:29 GMT Client-Peer: 172.20.3.239:5101 Client-Response-Num: 1 Title: Error 401 Unauthorized <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1 +"/> <title>Error 401 Unauthorized</title> </head> <body><h2>HTTP ERROR 401</h2> <p>Problem accessing /ws/stats-v2. Reason: <pre> Unauthorized</pre></p><hr /><i><small>Powered by Jetty://</sm +all></i><br/> ...

In SOAPUI it works fine. I think I'm having a problem with my Interface Properties in SoapUI.

if anyone has managed to achieved something similar please help.

A soapUI to perl converter would be great!!

Replies are listed 'Best First'.
Re: Soap:Lite accessing WSDL soapUI
by Anonymous Monk on Apr 05, 2018 at 20:24 UTC
    Soap::lite doesnt wsdl, use xml::compile