SOAP::Lite for Perl is a collection of Perl modules which provides a simple and lightweight interface to the Simple Object Access Protocol (SOAP, also known as Service Oriented Access Protocol) both on client and server side.
Last week I showed how to override the root element of a request, but did not show a way to do the same thing for the root element of a response. So, read on if you would like to know how to modify the response's namespace, namespace prefix, encoding style, etc. It is not very intuitive, or pretty for that matter, but at least it is relatively simple.
One thing I find myself constantly doing with my SOAP::Lite clients is commenting in and out the "+trace => 'debug'" from the "use SOAP::Lite" call so that I can turn on and off debugging information. This became so annoying to me that I decided to programitize it. Now I just turn debugging on and off with a command line flag.
Someone asked on the SOAP::Lite message board about how to specify multiple namespaces in a request. The following little code snippet answers that question. The trick is using the SOAP::Data->attr() subroutine...
SOAP::Lite's API allows you to call remote Web service operations easily within your code. Simply instantiate an instance of a service, and execute (or call) the remote method directly from your service instance. For example, a call might look like "$soap->myMethod(arguments)." However, while this convention makes for a nice API, by calling the method in this way you give up control over the attributes of the root SOAP Body element. So how do you change the namespace, the prefix, or attributes of the root element?
Someone posted a message to the SOAP::Lite newsgroup asking a common question: How do you nest XML elements using SOAP::Lite's SOAP::Data constructs. It is a simple problem, but enough people have problems with it that I figured I would detail the answer here.
A posting (which is not archived in the group for some reason) in the SOAP::Litemessage board raised yet again the shortcomings of SOAP::Lite and how it parses and interprets WSDL. It also brought to light a horrible SOAP Fault returned by Axis which led the poster and I in a completely mistaken direction when trying to solve the problem...
Recent Comments