Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I'm implementing a SOAP endpoint (server) that expects a SOAP envelope. The endpoint dispatches to various classes, according to the XML namespace of data in the body of the SOAP message. E.g.
<soap:Envelope> <soap:Body> <demo:helloworld> Data </demo:helloworld> </soap:Body> </soap:Envelope>
will call demo::helloworld. Everything works with simple namespaces like "demo", the trouble is that I need to handle SAML 2.0 profile of XACML v2.0, which sends messages in the "urn:oasis:names:tc:xacml:2.0:saml:protocol:schema:os" namespace. And Apache::SOAP just chokes with an error "Failed to access class (oasis:names:tc:xacml:2.0:saml:protocol:schema:os)". So my question is: how do I get Apache::SOAP to dispatch to an appropriate class? Can I configure Apache::SOAP to dispatch to a class with a different name? Or can I somehow make a class named "oasis:names:tc:xacml:2.0:saml:protocol:schema:os"?

Replies are listed 'Best First'.
Re: Apache::SOAP dispatch on odd namespaces
by Anonymous Monk on Jan 12, 2012 at 02:10 UTC

    ... So my question is: how do I get Apache::SOAP to dispatch to an appropriate class?

    You tell it to handle the namespace, either by register_ns (hopeful) or writing your own serializer

    I would seriously invest the time into learning XML::Compile, it actually supports WSDL, has modules like XML::Compile::SOAP::WSS - Web Service Security used in SOAP