RFC: SOAP module with implicit WSDL generation



Hi there,

for my current job, I've put together a module that
makes it easier to build basic web services around
SOAP::Transport::HTTP::CGI and that provides an
implicit functionality to generate the appropriate
WSDL file. It's still a bit of a hack, as it's simply
aimed to DWIM.

Basically, it consists of a module "WSDL::Easy" that's
used as the base class for all webservices, and a
submodule WSDL::Easy::Attribute that also employs
attribute magic and some TIE stuff. As a result, you
simply inherit from WSDL::Easy and declare your methods
like:

sub webmethod1
:in( "lala" => "string", "lolo" => "int" )
:out( "result" => "string" )
{
my( $class, $self ) = @_;
return [{ "result" => $self->{"lala"} . $self->{"lolo"} }];
}

In the CGI service script you include your module,
instantiate it with the name and SOAP-URI for the service
and invoke it's dispatch() method. If called with a GET
parameter of "WSDL", it returns the WSDL definition file,
though currently only for RPC style formatting.

At the time being, the return value is always an array
with the first element containing all the parameters defined
in the :out attribute, as this was the quickest way to get
Perl and PHP5 (which currently makes up the client side) to agree
on how to handle it.

More complex types will follow, for the first part I'll
implement nesting via hash/array refs in the in/out attributes.
Later on, I also plan to make it possible to define own complex
types separately from the subroutine using it.

I'd like to know if you've got any thoughts on that, either
wishes you have for such a module, practical experience
from work or caveats to consider, as I'm planning on releasing
it to CPAN once it's reasonably stable and tested, and I'd
rather avoid adding just another hardly-used WSDL thingy to
the repository.

-Chris
.



Relevant Pages

  • Re: WSDL Generated Proxy Classes?
    ... WSDL file is that each client can download the WSDL file and generate ... But what proxy classes do, the same can be done using business objects. ... Both Web Services & business objects require compiled objects that are ...
    (microsoft.public.dotnet.framework.aspnet)
  • Separate WSDL File
    ... I've created my own WSDL file and referenced an XSD file too. ... I've then set the Binding for the class and methods and set the ... up, add the reference, and all is ok. ...
    (microsoft.public.dotnet.xml)
  • Re: WSDL Generated Proxy Classes?
    ... Namespace lines) is encapsulated in an ASMX file after which WSDL is ... WSDL is Web Service Description Language. ... The advantage of generating a WSDL file is that each client can download the WSDL file and generate proxy "on the fly". ... However, there are also other consumers of web services, and they also create proxies in JavaScript dynamically using the WSDL file. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: How to Return an XML Doc via a Web Method
    ... There can be issues getting your .NET WSDL recognized in something ... but if you are interfacing with Java that is not an option (that I ... > I am trying to return an xml document from a asp .net web service. ... > WSDL file from a java client. ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: tclsoap array-based queries
    ... How to use the WSDL file ... The WSDL file provides a standard description of CDAS web services. ... error changes to: ...
    (comp.lang.tcl)