I hate to admit it, but I, too, have had my share of trouble with SOAP::Lite. I'm currently struggling to interoperate with a .Net service.

I found SOAP::Lite::Simple helpful in this respect. It learnt me a few tricks in dealing with the SOAP::Lite data structures, as well as figuring out what exactly the other side of the wire is expecting.

I'm not entirely convinced that the blame falls solely on SOAP::Lite, even though namespace support is not that great. The biggest problem with SOAP, in my opinion, is the protocol, and the fact that it works through XML wrappers. That means there are countless ways of screwing up, or "enhancing the protocol", simply by requiring a certain syntax for attributes, parameter types, etc.

One example I just ran into is this:

use SOAP::Lite; my $client = SOAP::Lite->new; $client->soapversion('1.1'); my $code = $client->service($WSDL_URL); my $result = $code->someMethod( $someParam );
Part of the fault response is this:
Possible SOAP version mismatch: Envelope namespace http://schemas.xmls +oap.org/wsdl/soap/ was unexpected. Expecting http://schemas.xmlsoap.o +rg/soap/envelope/.
I think .Net is being an ass here, but what do I know...

Using straightforward code like the following works fine, on the other hand:

my $soap = SOAP::Lite ->uri($uri) ->proxy($proxy) ->on_action( sub { return $uri . '/' . $method } ); my $result = $soap->$method( SOAP::Data->name( someParam => $some_valu +e ) );
In case you haven't found it in the docs yet, turning tracing on in SOAP::Lite can be quite helpful:
use SOAP::Lite ( +trace => 'all', readable => 1, outputxml => 1, );

In reply to Re: SOAP and Perl by rhesa
in thread SOAP and Perl 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.