[Xml-compile] Is XML::Compile the right tool for writing a SOAP
server?
Petar Shangov
pshangov at yahoo.com
Mon Mar 23 15:58:15 GMT 2009
Which seems to work fine until:
info: added 1 operations from WSDL
error: 2009/03/23-17:55:14 POSIX::sigemptyset not implemented on this architectu
re at C:/strawberry/perl/site/lib/Net/Server/Daemonize.pm line 233.
at line 293 in file C:/strawberry/perl/site/lib/Net/Server.pm
at C:/strawberry/perl/site/lib/XML/Compile/SOAP/Daemon.pm line 129
Net::Server::fatal(XML::Compile::SOAP::HTTPDaemon=HASH(0xcb9d24), "POSIX::sigemp
tyset not implemented on this architecture at C:/strawberry/perl/site/lib/Net/Se
rver/Daemonize.pm line 233.\n") at C:/strawberry/perl/site/lib/Net/Server.pm lin
e 293
Net::Server::post_configure(XML::Compile::SOAP::HTTPDaemon=HASH(0xcb9d24)) at C:
/strawberry/perl/site/lib/Net/Server/PreForkSimple.pm line 58
Net::Server::PreForkSimple::post_configure(XML::Compile::SOAP::HTTPDaemon=HASH(0
xcb9d24)) at C:/strawberry/perl/site/lib/Net/Server/PreFork.pm line 73
Net::Server::PreFork::post_configure(XML::Compile::SOAP::HTTPDaemon=HASH(0xcb9d2
4)) at C:/strawberry/perl/site/lib/XML/Compile/SOAP/Daemon.pm line 119
XML::Compile::SOAP::Daemon::post_configure(XML::Compile::SOAP::HTTPDaemon=HASH(0
xcb9d24)) at C:/strawberry/perl/site/lib/Net/Server.pm line 100
Net::Server::run(XML::Compile::SOAP::HTTPDaemon=HASH(0xcb9d24), "no_client_stdou
t", 1, "name", "my-first-server v0.1", "port", 8080, "host", [1 more]) at C:/str
awberry/perl/site/lib/XML/Compile/SOAP/Daemon.pm line 143
XML::Compile::SOAP::Daemon::run(XML::Compile::SOAP::HTTPDaemon=HASH(0xcb9d24), "
name", "my-first-server v0.1", "host", "localhost", "port", 8080) at soap_server
2.pl line 33
----- Original Message ----
> From: Mark Overmeer <mark at overmeer.net>
> To: Petar Shangov <pshangov at yahoo.com>
> Cc: XML-Compile <xml-compile at lists.scsys.co.uk>
> Sent: Monday, 23 March, 2009 17:39:47
> Subject: Re: [Xml-compile] Is XML::Compile the right tool for writing a SOAP server?
>
> * Petar Shangov (pshangov at yahoo.com) [090323 12:49]:
> > 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
>
> True... the server does not understand RPC(-literal) yet.
> The problem is that SOAP does not have a clean way to discover what
> the actual portType was. It sounds weird... but it is true: from the
> encoded body, you have to find back the message where it refers to,
> and hope that there is only a single match.
>
> So, the compileFilter() rule tries to detect whether the the found
> body element matches the choice for that body. When the body is
> defined by an element, that is simpler than when it is defined
> by a type. The latter not being very complicated either... just
> a matter of data-flow.
>
> We should try something like this: (XML/Compile/SOAP/Server.pm)
>
> sub compileFilter(@)
> { my ($self, %args) = @_;
> my $nodetype;
>
> if(my $first = $args{body}{parts}[0])
> - { $nodetype = $first->{element}
> - or panic "cannot handle type parameter in server filter";
> + { nodetype = $first->{element}
> + || $args->{body}{procedure};
> }
>
> # called with (XML, INFO)
> defined $nodetype
> ? sub { my $f = $_[1]->{body}[0]; defined $f && $f eq $nodetype }
> : sub { !defined $_[1]->{body}[0] }; # empty body
> }
>
> --
> 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