in reply to SOAP and Perl

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, );

Replies are listed 'Best First'.