[Xml-compile] Accessing schemaLocation attribute url values inside <include> elements

Morad IGMIR migmir at alliancemca.com
Fri Jul 16 12:40:47 GMT 2010


Hi Mark, thanks for your answer.

>In general (>50% of the WSDLs), these schemaLocations are wrong.

You're right. 
I find that to be specifically true with MS web services
And don't even mention their dummy SOAPAction headers. 
Meh.

> One WSDL can have multiple schemas...
>
>   foreach my $fragment ($wsdl->namespaces->allSchemas)
>   {   # $fragment is an XML::Compile::Schema::Instance
>       my @urls
>        = ( $fragment->includeLocations
>          , $fragment->importLocations
>          );
>   }

I did not think about the possibility of multiple schemas.
Thanks for the heads up.


> Knowing that these are your own schema's. So, you could do:
>    my @xsds = glob "$somewhere/*.xsd";
>    $wsdl->importDefinitions(\@xsds);

True, and I did initially.
but I have multiple SOAP services and clients, 
calling each other from quite a few different places.

The problem with the glob(*.xsd) approach was file distribution.

I had to remember to put a copy of the right set of files in the right
directory.
Copy all of them, on all servers (or svn update them all, if you will) 
whenever I had a minor update to make. Then there were times I'd forget to
update one, 
and kept wondering why things wouldn't work.

And that, is IMO, way too fastidious.

Using automatic internet fetching makes file distribution easy.
Only one set of wsdl/xsd per service, accessible through one url each.

It considerably lessened my margin of error

-- 
Regards,

               MarkOv

------------------------------------------------------------------------
       Mark Overmeer MSc                                MARKOV Solutions
       Mark at Overmeer.net                          solutions at overmeer.net
http://Mark.Overmeer.net                   http://solutions.overmeer.net

Ce message entrant est certifié sans virus connu.
Analyse effectuée par AVG - www.avg.fr 
Version: 9.0.830 / Base de données virale: 271.1.1/3008 - Date: 07/15/10
20:35:00




More information about the Xml-compile mailing list