You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Caleandro <ka...@katamail.com> on 2006/12/15 14:39:21 UTC

Using xmlcatalog in schema-validation

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.

Vito


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


R: R: Using xmlcatalog in schema-validation

Posted by Caleandro <ka...@katamail.com>.
Hi Peter,

Done trial, ... same results.

Hi did too many types of trial in past days.

I begin suspecting there may exist some problem in  processing the
"<xsd:include>" statement by the couple Xerces-resolver.
Could anyone do some simple analogous trial and compare his results with
mine?

Regards,
Vito

> -----Messaggio originale-----
> Da: Peter Reilly [mailto:peter.kitt.reilly@gmail.com]
> Inviato: lunedì 18 dicembre 2006 9.53
> A: Ant Users List
> Oggetto: Re: R: Using xmlcatalog in schema-validation
>
>
> I notice that the URI used does not have
> a protocol, perhaps you need to add "file:///"
> file:///d:/
>   <uri name="/SVIM_Schemas/custom_types.xsd"
>          uri="file:///D:/other_directory/custom_types.xsd" />
>
> But I have not tested this.
>
> Peter
>
> On 12/18/06, Caleandro <ka...@katamail.com> wrote:
> > Hi Antoine
> >
> > Thank you for your kind reply,
> > but I confirm that already had in my ANT\lib the resolver.jar
> when I did my
> > trials.
> > Nevertheless, I following your suggestion, I have downloaded
> and correctly
> > installed new resolver.jar (rel. 1.2), but... got the same results.
> >
> >
> > Regards,
> > Vito
> >
> >
> > -----Messaggio originale-----
> > Da: Antoine Levy-Lambert [mailto:antoine@gmx.de]
> > Inviato: sabato 16 dicembre 2006 6.53
> > A: Ant Users List
> > Oggetto: Re: Using xmlcatalog in schema-validation
> >
> >
> > Hello Caleandro,
> >
> > you might need to have xml-resolver.jar installed under $ANT_HOME/lib.
> >
> > The install.html lists this :
> >
> > resolver.jar 1.1beta or later
> > xmlcatalog datatype only if support for external catalog files is
> > desired
> > http://xml.apache.org/commons/.
> >
> > Regards,
> >
> > Antoine
> >
> >
> > On Dec 15, 2006, at 8:39 AM, 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.
> > >
> > > Vito
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>


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


Re: R: Using xmlcatalog in schema-validation

Posted by Peter Reilly <pe...@gmail.com>.
I notice that the URI used does not have
a protocol, perhaps you need to add "file:///"
file:///d:/
  <uri name="/SVIM_Schemas/custom_types.xsd"
         uri="file:///D:/other_directory/custom_types.xsd" />

But I have not tested this.

Peter

On 12/18/06, Caleandro <ka...@katamail.com> wrote:
> Hi Antoine
>
> Thank you for your kind reply,
> but I confirm that already had in my ANT\lib the resolver.jar when I did my
> trials.
> Nevertheless, I following your suggestion, I have downloaded and correctly
> installed new resolver.jar (rel. 1.2), but... got the same results.
>
>
> Regards,
> Vito
>
>
> -----Messaggio originale-----
> Da: Antoine Levy-Lambert [mailto:antoine@gmx.de]
> Inviato: sabato 16 dicembre 2006 6.53
> A: Ant Users List
> Oggetto: Re: Using xmlcatalog in schema-validation
>
>
> Hello Caleandro,
>
> you might need to have xml-resolver.jar installed under $ANT_HOME/lib.
>
> The install.html lists this :
>
> resolver.jar 1.1beta or later
> xmlcatalog datatype only if support for external catalog files is
> desired
> http://xml.apache.org/commons/.
>
> Regards,
>
> Antoine
>
>
> On Dec 15, 2006, at 8:39 AM, 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.
> >
> > Vito
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

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


R: Using xmlcatalog in schema-validation

Posted by Caleandro <ka...@katamail.com>.
Hi Antoine

Thank you for your kind reply,
but I confirm that already had in my ANT\lib the resolver.jar when I did my
trials.
Nevertheless, I following your suggestion, I have downloaded and correctly
installed new resolver.jar (rel. 1.2), but... got the same results.


Regards,
Vito


-----Messaggio originale-----
Da: Antoine Levy-Lambert [mailto:antoine@gmx.de]
Inviato: sabato 16 dicembre 2006 6.53
A: Ant Users List
Oggetto: Re: Using xmlcatalog in schema-validation


Hello Caleandro,

you might need to have xml-resolver.jar installed under $ANT_HOME/lib.

The install.html lists this :

resolver.jar 1.1beta or later
xmlcatalog datatype only if support for external catalog files is
desired
http://xml.apache.org/commons/.

Regards,

Antoine


On Dec 15, 2006, at 8:39 AM, 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.
>
> Vito



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


Re: Using xmlcatalog in schema-validation

Posted by Antoine Levy-Lambert <an...@gmx.de>.
Hello Caleandro,

you might need to have xml-resolver.jar installed under $ANT_HOME/lib.

The install.html lists this :

resolver.jar 1.1beta or later
xmlcatalog datatype only if support for external catalog files is  
desired
http://xml.apache.org/commons/.

Regards,

Antoine


On Dec 15, 2006, at 8:39 AM, 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.
>
> Vito


Re: Using xmlcatalog in schema-validation

Posted by Steve Loughran <st...@apache.org>.
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