[Xml-compile] namespace adjustment

Mark Overmeer mark at overmeer.net
Sat Apr 15 09:10:57 GMT 2017


* Jack Downes (jax at nwmt.us) [170415 07:49]:
> Hello, I'm new to using XML::Compile and all it's related modules.
>  Today is my first day in fact!
> 
> So, I'll present what I need, what I'm producing, and the code used to
> do so.  Hope this helps explain my problem:
> 
> What I'm expected to produce:
> 
>   <soap12:Body>
>     <ProcessEligibility xmlns="https://claims.realmed.com">;
>       <request>
> 
> What I'm getting:
> 
>   <env12:Body>
>     <tns:ProcessEligibility xmlns:tns="https://claims.realmed.com">;
>       <tns:request>

> So... the problem, well, I think it's an issue anyway, is the various
> namespace identifiers.  How do I make it so there are no  "tns:"
> markers?  Also, it looks like "env12:" should be "soap12"

In the design of XML, the prefix (like soap12, env12, tns, or '') do
not matter: they are abbreviations for the namespaces which look like
URIs.  Above fragments mean exactly the same.

When you want a blank prefix to be used, you can use the
    use_default_namespace => 1

Better to avoid the '' prefix for a namespace: it is also possible
to have schema's which do not use namespaces (very bad idea, but they
do exist)  They would also have no prefix.  Confusion all over the
place.

Or even specify your preference by:

   $wsdl->new(...
      prefixes => {
          soap12 => "http://www.w3.org/2003/05/soap-envelope",
          '' => 'https://claims.realmed.com',
      }
   );

> The endpoint is a Microsoft server *I think*, but vendor won't confirm.

You do not need to specify the server's type.  Some servers produce
error messages which use their private schema... to be able to interpret
those correctly, you need to load that schema.  By specifying the
server type, that schema is loaded for you... but in practive, usually
those extensions are invisible for a well-behaving server.
-- 
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