Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: SOAP, WSDL, XML service/client

by jhourcle (Prior)
on Sep 09, 2013 at 16:49 UTC ( #1053040=note: print w/replies, xml ) Need Help??


in reply to SOAP, WSDL, XML service/client

You don't need XML::LibXML, as SOAP::Lite does the unpacking for you.

As for the WSDL, if you're only going to be calling this from SOAP::Lite, and will never need to use another language to access it, you can probably ignore that part, too. (SOAP::Lite will handle *most* things correctly when serializing, but if you have a string that looks like a number, it could flag it as an integer, and then strictly typed languages get really, really upset).

For the sample code, take a look at the SOAP::Lite cookbook. It covers all of your questions. (the webserver-less version is SOAP::Transport::HTTP::Daemon)

Replies are listed 'Best First'.
Re^2: SOAP, WSDL, XML service/client
by agentorange (Sexton) on Sep 09, 2013 at 16:58 UTC

    Thank you.

    Looks like I can make use of "dispatch_to(..)" to process the XML as well.

    http://cookbook.soaplite.com/#writing%20a%20server

    I will need WSDL though. I've a project spinning up and I can see that a web service for a tiny part of it will be really useful and I know the other guys will be querying it with something other than Perl. Probably Java.

      Creating a WSDL ater the fact, especially if you have complex structures (hashes of arrays of hashes of hashes) gets really, really messy. I'd highly recommend reading Which style of WSDL should I use? and Re: Starting on SOAP before you even start.

      As you're using a WSDL file, you can drop the typing of each and every variable, and go with RPC/literal or doc/lit wrapped. (RPC/encoded, which is SOAP::Lite's default is useful if you don't have a firm specification, and the clients are flexible enough to deal with changes, but it causes no end of headaches with C and Java clients if something gets typed wrong)

      There are also some absolutely awful SOAP services out there -- the strangest one that I have to deal with, the programmers obviously didn't understand SOAP, because they return a single value (an XML encoded string, that has multiple values encoded in it).

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2019-04-21 02:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I am most likely to install a new module from CPAN if:
















    Results (110 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!