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 :
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 .
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 :
In normal SOAP::Lite usage afaik you can override this easier, but if want to use the wsdl functionality, then use thisuse HTTP::Cookies; my $c = HTTP::Cookies->new(ignore_discard => 1); $self->cookie_jar( $c);
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 .
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Starting on SOAP
by erroneousBollock (Curate) on Nov 14, 2007 at 04:53 UTC | |
by rootcho (Pilgrim) on Nov 15, 2007 at 02:26 UTC | |
Re^2: Starting on SOAP
by harsha.reddy (Acolyte) on Nov 14, 2007 at 05:01 UTC | |
by erroneousBollock (Curate) on Nov 14, 2007 at 05:13 UTC |
In Section
Seekers of Perl Wisdom