Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: Starting on SOAP

by erroneousBollock (Curate)
on Nov 14, 2007 at 04:53 UTC ( [id://650672]=note: print w/replies, xml ) Need Help??


in reply to Re: Starting on SOAP
in thread Starting on SOAP

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.
SOAP::Lite has absorbed some but not all functionality from SOAP::WSDL.

If you want to send objects (complexTypes) to a SOAP web-service use SOAP::WSDL. It works. Really.

Hand-building XML for SOAP (even using templates) is just a waste of time. That's what WSDL is for.

The only conceivably non-useless scenario I can think of for partially building SOAP messages with templates is the case where the web-service expects Document/Literal (or .NET) encoding, but at the same time allows for recursively defined complexTypes to be passed. That's quite a lot more complicated than what most developers have to deal with.

Everyone should know that "SOAP Interoperability" is a cosmic-scale joke perpetrated on the industry by hermit-like evil geniuses.

That being said, it's still much better to use SOAP::WSDL and to override its default behaviour where necessary. If you find you're using set of overrides a lot, create a sub-class of SOAP::WSDL. Simple.

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.
If you've gone down this path because SOAP::Lite / SOAP::WSDL don't yet implement the WSDL 'import' construct... that's a little drastic :-)

You have a few options:

  • Alter the web-service (if you wrote it) to "inline" the XSD schemas.
  • Save the WSDL file and modify it by hand to include the imported XSD schemas inline.
  • Get some off-the-shelf XSL to transform the WSDL such that the XSD schemas are inlined. You could even create a WSDL proxy service to automate the process.
In summary, stop doing things the hard way. ;)

-David

Replies are listed 'Best First'.
Re^3: Starting on SOAP
by rootcho (Pilgrim) on Nov 15, 2007 at 02:26 UTC
    when I started the project, SOAP::WSDL wasn't so advanced ;(, but I will definitely will give it another try.
    Seems much promising now.

    I don't have access to the SOAP server.(it is Java based server and they have libs only for Java and .NET).

    Everyone should know that "SOAP Interoperability" is a cosmic-scale joke perpetrated on the industry by hermit-like evil geniuses

    liked that ;)

    Didn't knew that import was not supported, thanx for telling me that..

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://650672]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-25 18:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found