ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <ste...@apache.org>
Subject Re: Using xmlcatalog in schema-validation
Date Mon, 18 Dec 2006 11:01:07 GMT
Caleandro wrote:
> Hi Ant users,
> 
> I need to validate a Soap-message against a compound schema, (yes!, a very
> common problem today ;-).
> I need to map two components of the schema (of soap-body part) with other
> resources with respect of those declared in  the including schema.
> 
> Something like this:
> 
> main schema:
> 
> <?xml version= "1.0" encoding = "UTF-8" ?>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> targetNamespace="http://www.svimservice.it/Schemas/PDD_SISR/SCATEL/"
> xmlns="http://www.svimservice.it/Schemas/PDD_SISR/SCATEL/"
> elementFormDefault="qualified" attributeFormDefault="unqualified">
> <xsd:include schemaLocation="/SVIM_Schemas/custom_types.xsd"/>  (shared
> common components)
> <xsd:include schemaLocation="/SVIM_Schemas/soapFault.xsd"/>     (of same
> target-namespace)
>   <xsd:element  name="getMedicoDiBaseResponse" type =
> "yyy_getMedicoDiBaseResponse">
> .....
> 
> for example: the '/SVIM_Schemas/custom_types.xsd' need to be mapped to
> 'D:/other_directory/custom_types.xsd.
> 
> I tried using this "xmlcatalog" (that seems correctly parsed during ant
> task):
> 
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <!--  Catalogo delle risorse XML utilizzate per la validazione dei messaggi
> SOAP di SIST e PDD-SISR
>                       Creato da Vito Caleandro  - 14 Dicembre 2006 -->
> <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" >
> 	<uri name="/SVIM_Schemas/custom_types.xsd"
> uri="D:/other_directory/custom_types.xsd" />
> 	<uri name="/SVIM_Schemas/soapFault.xsd"
> uri="D:/other_directory/soapFault.xsd" />
> </catalog>
> 
> The envelope and main body-part schema were normally added, but the ant
> debug messages I got, were always the same (both for 1.6.5 and 1.7.0
> versions and for xmlvalidate or schemavalidate tasks) :
> ...
> resolveEntity: 'null': 'file:/SVIM_Schemas/custom_types.xsd']]></message>
> No matching catalog entry found, parser will use:
> 'file:/SVIM_Schemas/custom_types.xsd']]></message>
> resolveEntity: 'null': 'file:/SVIM_Schemas/soapFault.xsd']]></message>
> No matching catalog entry found, parser will use:
> 'file:/SVIM_Schemas/soapFault.xsd']]></message>
> ...
> 
> Where I do the error?
> 
> Thanks to anyone who can help me.

I dont know about catalogs, but the code I use to validate SOAP messages 
is here:
http://deployment.cvs.sourceforge.net/deployment/deployment/build.xml?view=markup


     <presetdef name="validate-xsd">
       <schemavalidate>
         <schema namespace="http://www.w3.org/2001/XMLSchema"
                 file="${soap.dir}/XMLSchema.xsd"/>
         <schema namespace="http://www.w3.org/XML/1998/namespace"
                 file="${soap.dir}/xml.xsd"/>
         <dtd publicId="http://www.w3.org/2001/datatypes.dtd"
              location="${soap.dir}/datatypes.dtd"/>
       </schemavalidate>
     </presetdef>

     <presetdef name="validate-soap">
       <validate-xsd>
         <schema namespace="http://www.w3.org/2003/05/soap-envelope"
                 file="${soap12.xsd}"/>
         <schema namespace="http://schemas.xmlsoap.org/wsdl/"
                 file="${soap.dir}/wsdl.xsd"/>
         <schema namespace="http://schemas.xmlsoap.org/wsdl/soap/"
                 file="${soap.dir}/wsdlsoap.xsd"/>
       </validate-xsd>
     </presetdef>

Works pretty well

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message