I'm trying to do a SOAP call to http://www.webservicex.net/ConvertSpeed.asmx

My code as follows :

use SOAP::Lite; my $client = SOAP::Lite->new; $client = $client->service( "http://www.webservicex.net/ConvertSpee +d.asmx?wsdl" ); my $soapResp = $client->call( "ConvertSpeed", 100, "kilometersPerhour" +, "milesPerhour" ); if ( $soapResp->fault ) { print $soapResp->faultstring; } else { print $soapResp->result; }

This gives me the following error :

A service address has not been specified either by using SOAP::Lite->proxy() or a service description)

As far as I understand it the service address is obtained from the WSDL. I did however try using
$client->proxy("http://www.webservicex.net/ConvertSpeed.asmx"), but then I got the following error :

Server did not recognize the value of HTTP Header SOAPAction: #ConvertSpeed

Since the WSDL is supposed to handle the service address I removed the $client->proxy() bit and tried
other stuff. I have been struggling with this for 2 days now so I can't recall everything I tried, but
I did reduce method chaining a lot from my initial code to what I posted above. I also tried using
$client->ConvertSpeed(100, "kilometersPerhour", "milesPerhour") directly as I have seen it done this way
elsewhere, but it seems to not return anything.

This is running on Perl 5.10 and version 0.714 of SOAP::Lite.
I have also tested on Perl 5.22.1 and version 1.19.

I have also confirmed that this SOAP call works in other languages.


In reply to Problem with SOAP call using SOAP::Lite and wsdl by Anonymous Monk

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.