[Xml-compile] XML::Compile::SOAP::Server namespace usage

Mark Overmeer mark at overmeer.net
Tue Jun 30 19:00:20 GMT 2009


* Mark Blackman (m.blackman at fairfx.com) [090630 15:10]:
>> Do you mean "prefix" where you write "namespace"?
>     $self->{response}{'soap:Body'}{"${method}Response"}
> correctly deduced that 'prefix' is the correct term.

Yes.  Problem is that the namespace well-defined but long, and therefore
a temporary nickname get's introduced as prefix.

XML::Compile (in more recent versions) tries to reuse prefixes from
as they are found in the schema/WSDL.  But, there are possibilities
for conflicts which result in generated prefixes like x0...  Besides,
XML::Compile will avoid using the default prefix '', which causes
problems when namespace-less elements are mixed in.

The first attempt to register a prefix-uri combination wins. So, if
you want to enforce a prefix, call the prefix() method before
compiling calls.

   use XML::Compile::SOAP ':soap11';
   $wsdl->prefixes(soap => SOAP11ENV);

This is very much advised when using
   $wsdl->addKeyRewrite('PREFIXED')
where the prefix of each namespace is added to the key resulting in
   $self->{response}{soap_Body}{...
Of course, in this case you do not want a change in sender's use
of prefixes affect your own code.  The PREFIXED rewrite uses your
own mapping, not the one found in the message.
-- 
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