http://www.perlmonks.org?node_id=650644


in reply to Starting on SOAP

I had to use SOAP.. so I started with SOAP::Lite.. a good module but very complex, especially if you have to read the internals.... oo maaan :), they are complex.
In the beginning I tried creating objects (bless {...}) and pass them to SOAP to create the xml-message, but this didn't worked well. Most of the times it created SOAP-xml that wasn't what the other side expected i.e. it was useless.
So my final solution was to use SOAP::Lite like wrapper for the communication and build the XML myself via Template-toolkit. I find the pseudo XPath expressions you can use on the result very useful.

The bad thing about this approach is that you have to read .wsdl and .xsd specs :( arggh..
One more thing to know about .wsdl. What SOAP::Lite does is it parses the .wsdl file and creates a module on the fly with all the methods, but that is. It does not go further to parse .xsd schemas, so you are on your own from there.
Another thing to be aware is if you have to preserve sessions and also use WSDL ->service() method i.e. you want to login with the first request and reuse this on subsequent one. To solve this I modified SOAP::Lite itself. At the end of SOAP::Lite::HTTP::new() add the following code :
use HTTP::Cookies; my $c = HTTP::Cookies->new(ignore_discard => 1); $self->cookie_jar( $c);
In normal SOAP::Lite usage afaik you can override this easier, but if want to use the wsdl functionality, then use this

hth

PS> If you decide to use TT like me to build the SOAP message I will recommend you to read the tutorials on : http://www.w3schools.com for XML Schema.
One thing to know 'S' in SOAP does not mean Simple, really .