I am trying to call a Soap Webservice.I have to pass the name of a Code table (for eg STATE_CODES) and it returns key value pair like NY - New york, DE-Delaware etc.

#!/usr/local/bin/perl use strict; use warnings; use Data::Dumper qw<Dumper>; #use SOAP::Lite trace=>'all'; use SOAP::Lite +trace =>'debug'; #use SOAP::Lite; $ENV{PERL_LWP_SSL_VERIFY_HOSTNAME}=0; use Data::Dumper; $Data::Dumper::Terse = 1; $Data::Dumper::Indent = 1; #my $wsdl = 'https://dev1:2001/ACTS?wsdl'; my $endpoint = 'https://qa1:2001/ACTS'; my $wsdl = 'HTTPS://QA1:2001/ACTS?wsdl'; my $method_name = 'impl:getCodes'; my $uri = 'http://impl.webservice.acts.ito.aoc.nj'; my $ns = 'http://impl.webservice.acts.ito.aoc.nj'; my $client = SOAP::Lite->new( proxy=>$endpoint, service=>$wsdl, readable=>1 ); $client->outputxml(1); $client->envprefix('soapenv'); $client->ns($uri,'impl'); $client->outputxml('true'); my @param; push @param, SOAP::Data->name("codeTable"=>'STATE_CODES'); my $soapResp = $client->call($method_name,@param); print $soapResp; print "\n";

output is as below
root@np1 ~# perl /test/soaptest6.pl
SOAP::Transport::HTTP::Client::send_receive: POST https://qa1:2001/ACTS HTTP/1.1
Accept: text/xml
Accept: multipart/*
Accept: application/soap
Content-Length: 580
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://impl.webservice.acts.ito.aoc.nj#getCodes"

<?xml version="1.0" encoding="UTF-8"?>
<codeTable xsi:type="xsd:string">STATE_CODES</codeTable>
SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Error
Connection: close
Content-Type: text/xml; charset=utf-8
Client-Date: Sat, 24 Oct 2020 02:46:04 GMT
Client-Response-Num: 1
Client-SSL-Cert-Issuer: /CN=qa1
Client-SSL-Cert-Subject: /CN=qa1
Client-SSL-Cipher: ECDHE-RSA-AES256-GCM-SHA384
Client-SSL-Socket-Class: IO::Socket::SSL
Client-SSL-Warning: Peer certificate not verified
X-Backside-Transport: FAIL FAIL

<?xml version='1.0' ?>
<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
<faultstring>Internal Error</faultstring>
<?xml version='1.0' ?>
<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
<faultstring>Internal Error</faultstring>

The soap request kind of looks good, but it gives error. I pasted the soap request into SOAPUI from the soapActionand it worked.

Why is my soap request resulting in failure. is it because of some certificate issue. i believe i have asked the code to skip certificate validation and Client-SSL-Warning: Peer certificate not verified in output above is just a warning and can be ignored

Is the line between getCodes" and <?xml version="1.0"... in soapAction causing failure. The request failed in SOAPUI if I added a line before the <?xml version="1.0"...

if it helps, the soap webservice is a java application on websphere and it is being accessed by perl through datapower.

In reply to Soap Call fails by PerlMASA

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, 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, 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.