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!!


In reply to Soap:Lite accessing WSDL soapUI by pearlyking

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.