[Xml-compile] Is XML::Compile the right tool for writing a SOAP server?

Petar Shangov pshangov at yahoo.com
Mon Mar 23 12:49:28 GMT 2009


Hi Mark,

using:

  XML::Compile::SOAP 2.02, released 2009-02-23
  XML::Compile::SOAP::Daemon 2.01, released 2009-02-23

excerpt from my daemon script:

  my $daemon = XML::Compile::SOAP::HTTPDaemon->new;
  my $wsdl = XML::Compile::WSDL11->new("path/to/tm.wsdl");

  my %callbacks = (get_set => \&TM::WebServices::get_set);
  $daemon->operationsFromWSDL($wsdl, callbacks => \%callbacks);

  $daemon->run( ...);

running the script dies with:

  panic: cannot handle type parameter in server filter
   at C:/strawberry/perl/site/lib/XML/Compile/SOAP/Server.pm line 86
  XML::Compile::SOAP::Server::compileFilter(XML::Compile::SOAP11::Server=HASH(0x1c656ac), "body", HASH(0x1c65b9c)) at C:/strawberry/perl/site/lib/XML/Compile/SOAP11/Operation.pm line 204
  XML::Compile::SOAP11::Operation::compileHandler(XML::Compile::SOAP11::Operation=HASH(0x1c6578c), "callback", CODE(0x1a94e14)) at C:/strawberry/perl/site/lib/XML/Compile/SOAP/Daemon.pm line 228
  XML::Compile::SOAP::Daemon::operationsFromWSDL(XML::Compile::SOAP::HTTPDaemon=HASH(0xc731bc), XML::Compile::WSDL11=HASH(0xfaae24), "callbacks", HASH(0x19a0f3c))
   at soap_server2.pl line 31 # this is the line with $daemon->operationsFromWSDL( ... )

here is where XML::Compile::SOAP::Server dies:

  sub compileFilter(@) {   
    my ($self, %args) = @_;
    my $nodetype;
    if(my $first = $args{body}{parts}[0])
    {
      # this here dies because I have $first->{type} rather than $first->{element}
      $nodetype = $first->{element} or panic "cannot handle type parameter in server filter";
    }

and this is the relevant part of my wsdl:
  <wsdl:message name="msg_get_set_in">
    <wsdl:part name="insert" type="tns:TransUnit"></wsdl:part>
    <wsdl:part name="get" type="tns:TransUnit"></wsdl:part>
  </wsdl:message>


PS: Is there any HACKING.pod or some other place I can learn about the overall design of XML::Compile so that I can find my way around the code easier?

Regards,
Petar



----- Original Message ----
> From: Mark Overmeer <mark at overmeer.net>
> To: Petar Shangov <pshangov at yahoo.com>
> Cc: xml-compile at lists.scsys.co.uk
> Sent: Saturday, 21 March, 2009 22:25:09
> Subject: Re: [Xml-compile] Is XML::Compile the right tool for writing a SOAP server?
> 
> * Petar Shangov (pshangov at yahoo.com) [090321 15:57]:
> > I spent some time yesterday studying the examples and testing
> > XML::Compile::SOAP::Daemon. I got stuck at one point where XML::C:S was
> > looking for an 'element' in my wsdl message definition where I had a
> > 'type' instead (I am writing from home now and I do not have the code
> > in front of me so I cannot be more specific ...) Does XML::C:S have a
> > specific preference for document-style soap or does it tolerate rpc as
> > well (my current wsdl is based on the older wsdl for the SOAP-Lite based
> > service so it is rpc-literal)?
> 
> Are you using the latest 2.* versions?
> Send me what you try, and I will take a look at it.  I may learn your
> needs, and therewith improve the implementation and/or documentation.
> 
> > Furthermore, this is a milti-user application and I do not know how
> > well Net::Daemon can scale for multiple users compared to apache.
> 
> Probably Net::Daemon is more straight-forward so faster.  Depends on what
> you configure.  It is quite easy to merge tasks in any daemon.
> 
> > Anyway, at the end of the day I decided to try to use SOAP::Lite for
> > the soap layer, and have XML::C handle only the serialization of perl
> > data to XML.
> 
> Then you have to maintain two large modules. 
> 
> > There is also SOAP::WSDL, which I have yet to look at.
> 
> SOAP::WSDL has many limitations (have used [and rewritten] it intensively)
> Its successor is better: SOAP::WSDL2.
> -- 
> Regards,
>                MarkOv
> 
> ------------------------------------------------------------------------
>        Mark Overmeer MSc                                MARKOV Solutions
>       Mark at Overmeer.net                          solutions at overmeer.net
> http://Mark.Overmeer.net                  http://solutions.overmeer.net




More information about the Xml-compile mailing list