You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by Emmanuel Guiton <em...@elodig.fr> on 2007/07/06 15:05:57 UTC

External schema validation using Xerces from behind a proxy

Hello,

I am working on an application which needs to perform XML validation
against a schema which includes online references. E.g.
<xs:import namespace="http://www.w3.org/2000/09/xmldsig#"
schemaLocation="http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd"/>


The problem is that there is a proxy between Xerces and the outside
world. So far, Xerces fails to access the external schema. What must we
do in order to make Xerces use the proxy to fetch the external schema ?

I saw in the FAQ that using Xerces-j one "must  set the two
system properties: "http.proxyHost" and "http.proxyPort" ". Is there any
equivalent in Xerces-c ?

Thanks for any help,
 - Emmanuel

-- 
Directeur
Elodig SARL
30-32, avenue de la République
94800 Villejuif
Tel:    01 46 77 47 68
E-mail: emmanuel.guiton@elodig.fr
http://www.elodig.fr

Re: External schema validation using Xerces from behind a proxy

Posted by Emmanuel Guiton <em...@elodig.fr>.
Hi Ming,

Sorry, I did not remember you mentioned that feature. We'll get a deeper
look at it when we will be back on the subject after the weekend.

Many thanks,
 - Emmanuel


Ming Zhu wrote:
> Hi Emmanuel,
> 
> In fact, I have mentioned in my last email that WSDL4CPP tool provides
> an extension patch of Xerces-C, such that users can use "libcurl" as
> the http transport layer. Hence you can use proxy without any problem
> because libcurl has all of these functions.
> For WSDL4CPP, see http://wsdl4cpp.sourceforge.net
> 
> Regards,
> Ming
> 
> 
> On 7/6/07, Emmanuel Guiton <em...@elodig.fr> wrote:
>> Hello,
>>
>> I am working on an application which needs to perform XML validation
>> against a schema which includes online references. E.g.
>> <xs:import namespace="http://www.w3.org/2000/09/xmldsig#"
>> schemaLocation="http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd"/>
>>
>>
>>
>> The problem is that there is a proxy between Xerces and the outside
>> world. So far, Xerces fails to access the external schema. What must we
>> do in order to make Xerces use the proxy to fetch the external schema ?
>>
>> I saw in the FAQ that using Xerces-j one "must  set the two
>> system properties: "http.proxyHost" and "http.proxyPort" ". Is there any
>> equivalent in Xerces-c ?
>>
>> Thanks for any help,
>>  - Emmanuel
>>
> 
> 

-- 
Directeur
Elodig SARL
30-32, avenue de la République
94800 Villejuif
Tel:    01 46 77 47 68
E-mail: emmanuel.guiton@elodig.fr
http://www.elodig.fr

Re: External schema validation using Xerces from behind a proxy

Posted by Ming Zhu <mi...@gmail.com>.
Hi Emmanuel,

In fact, I have mentioned in my last email that WSDL4CPP tool provides
an extension patch of Xerces-C, such that users can use "libcurl" as
the http transport layer. Hence you can use proxy without any problem
because libcurl has all of these functions.
For WSDL4CPP, see http://wsdl4cpp.sourceforge.net

Regards,
Ming


On 7/6/07, Emmanuel Guiton <em...@elodig.fr> wrote:
> Hello,
>
> I am working on an application which needs to perform XML validation
> against a schema which includes online references. E.g.
> <xs:import namespace="http://www.w3.org/2000/09/xmldsig#"
> schemaLocation="http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd"/>
>
>
> The problem is that there is a proxy between Xerces and the outside
> world. So far, Xerces fails to access the external schema. What must we
> do in order to make Xerces use the proxy to fetch the external schema ?
>
> I saw in the FAQ that using Xerces-j one "must  set the two
> system properties: "http.proxyHost" and "http.proxyPort" ". Is there any
> equivalent in Xerces-c ?
>
> Thanks for any help,
>  - Emmanuel
>

Re: External schema validation using Xerces from behind a proxy

Posted by Alberto Massari <am...@datadirect.com>.
Hi Antoine,
you will have to rebuild Xerces from the sources, 
being sure to specify the -n libwww option to 
runConfigure; otherwise Xerces uses a simple socket-based NetAccessor.

Alberto

At 16.27 06/07/2007 +0200, Antoine Journaux wrote:
>Hi,
>
>
>Thanks Alberto, but unfortunately, I've already 
>try to set environment variables http_proxy (and 
>I've also set no_proxy) and it seems that Xerces do not use those variables.
>
>Rebuilding Xerces seems to be difficult, before 
>doing it I'd rather be sure that works.
>
>
>
>Antoine
>
>
>Alberto Massari wrote:
>>Hi Emmanuel,
>>you can also try to rebuild Xerces using libWWW 
>>as NetAccessor; I am not sure if the API used 
>>include support for proxy servers, but you can 
>>then try to set the environment variable 
>>http_proxy="http://your.proxy.server:8080/" and
>>no_proxy="cern.ch,ncsa.uiuc.edu,some.host:8080" 
>>before running your application.
>>Alberto
>>At 15.47 06/07/2007 +0200, Emmanuel Guiton wrote:
>>>Hi Alberto,
>>>
>>>Thanks a lot for the tip.
>>>
>>>Unfortunately, we are working on Linux machines and I must admit I would
>>>prefer a lighter solution.
>>>Has anyone else already encountered and solved this issue in a different
>>>way?
>>>
>>>  - Emmanuel
>>>
>>>
>>>Alberto Massari wrote:
>>> > Hi Emmanuel,
>>> > the NetAccessor modules that Xerces-C++ include don't have support for
>>> > proxy servers; if you are on Windows you can try getting the code
>>> > attached to bug#692 (http://issues.apache.org/jira/browse/XERCESC-692)
>>> > and building a custom version of Xerces that uses WinInet (that should
>>> > pick the proxy settings used by Internet Explorer)
>>> >
>>> > Hope this helps,
>>> > Alberto
>>> >
>>> > At 15.05 06/07/2007 +0200, Emmanuel Guiton wrote:
>>> >> Hello,
>>> >>
>>> >> I am working on an application which needs to perform XML validation
>>> >> against a schema which includes online references. E.g.
>>> >> <xs:import namespace="http://www.w3.org/2000/09/xmldsig#"
>>> >> 
>>> schemaLocation="http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd"/>
>>> >>
>>> >>
>>> >>
>>> >> The problem is that there is a proxy between Xerces and the outside
>>> >> world. So far, Xerces fails to access the external schema. What must we
>>> >> do in order to make Xerces use the proxy to fetch the external schema ?
>>> >>
>>> >> I saw in the FAQ that using Xerces-j one "must  set the two
>>> >> system properties: "http.proxyHost" and "http.proxyPort" ". Is there any
>>> >> equivalent in Xerces-c ?
>>> >>
>>> >> Thanks for any help,
>>> >>  - Emmanuel
>>> >>
>>> >> --
>>> >> Directeur
>>> >> Elodig SARL
>>> >> 30-32, avenue de la République
>>> >> 94800 Villejuif
>>> >> Tel:    01 46 77 47 68
>>> >> E-mail: emmanuel.guiton@elodig.fr
>>> >> http://www.elodig.fr
>>> >
>>> >
>>> >
>>>
>>>--
>>>Directeur
>>>Elodig SARL
>>>30-32, avenue de la République
>>>94800 Villejuif
>>>Tel:    01 46 77 47 68
>>>E-mail: emmanuel.guiton@elodig.fr
>>>http://www.elodig.fr
>>


Re: External schema validation using Xerces from behind a proxy

Posted by Antoine Journaux <an...@elodig.fr>.
Hi,


Thanks Alberto, but unfortunately, I've already try to set environment 
variables http_proxy (and I've also set no_proxy) and it seems that 
Xerces do not use those variables.

Rebuilding Xerces seems to be difficult, before doing it I'd rather be 
sure that works.



Antoine


Alberto Massari wrote:
> Hi Emmanuel,
> you can also try to rebuild Xerces using libWWW as NetAccessor; I am not 
> sure if the API used include support for proxy servers, but you can then 
> try to set the environment variable 
> http_proxy="http://your.proxy.server:8080/" and
> no_proxy="cern.ch,ncsa.uiuc.edu,some.host:8080" before running your 
> application.
> 
> Alberto
> 
> At 15.47 06/07/2007 +0200, Emmanuel Guiton wrote:
>> Hi Alberto,
>>
>> Thanks a lot for the tip.
>>
>> Unfortunately, we are working on Linux machines and I must admit I would
>> prefer a lighter solution.
>> Has anyone else already encountered and solved this issue in a different
>> way?
>>
>>  - Emmanuel
>>
>>
>> Alberto Massari wrote:
>> > Hi Emmanuel,
>> > the NetAccessor modules that Xerces-C++ include don't have support for
>> > proxy servers; if you are on Windows you can try getting the code
>> > attached to bug#692 (http://issues.apache.org/jira/browse/XERCESC-692)
>> > and building a custom version of Xerces that uses WinInet (that should
>> > pick the proxy settings used by Internet Explorer)
>> >
>> > Hope this helps,
>> > Alberto
>> >
>> > At 15.05 06/07/2007 +0200, Emmanuel Guiton wrote:
>> >> Hello,
>> >>
>> >> I am working on an application which needs to perform XML validation
>> >> against a schema which includes online references. E.g.
>> >> <xs:import namespace="http://www.w3.org/2000/09/xmldsig#"
>> >> 
>> schemaLocation="http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd"/> 
>>
>> >>
>> >>
>> >>
>> >> The problem is that there is a proxy between Xerces and the outside
>> >> world. So far, Xerces fails to access the external schema. What 
>> must we
>> >> do in order to make Xerces use the proxy to fetch the external 
>> schema ?
>> >>
>> >> I saw in the FAQ that using Xerces-j one "must  set the two
>> >> system properties: "http.proxyHost" and "http.proxyPort" ". Is 
>> there any
>> >> equivalent in Xerces-c ?
>> >>
>> >> Thanks for any help,
>> >>  - Emmanuel
>> >>
>> >> --
>> >> Directeur
>> >> Elodig SARL
>> >> 30-32, avenue de la République
>> >> 94800 Villejuif
>> >> Tel:    01 46 77 47 68
>> >> E-mail: emmanuel.guiton@elodig.fr
>> >> http://www.elodig.fr
>> >
>> >
>> >
>>
>> -- 
>> Directeur
>> Elodig SARL
>> 30-32, avenue de la République
>> 94800 Villejuif
>> Tel:    01 46 77 47 68
>> E-mail: emmanuel.guiton@elodig.fr
>> http://www.elodig.fr
> 
> 
> 

Re: External schema validation using Xerces from behind a proxy

Posted by Alberto Massari <am...@datadirect.com>.
Hi Emmanuel,
you can also try to rebuild Xerces using libWWW 
as NetAccessor; I am not sure if the API used 
include support for proxy servers, but you can 
then try to set the environment variable 
http_proxy="http://your.proxy.server:8080/" and
no_proxy="cern.ch,ncsa.uiuc.edu,some.host:8080" 
before running your application.

Alberto

At 15.47 06/07/2007 +0200, Emmanuel Guiton wrote:
>Hi Alberto,
>
>Thanks a lot for the tip.
>
>Unfortunately, we are working on Linux machines and I must admit I would
>prefer a lighter solution.
>Has anyone else already encountered and solved this issue in a different
>way?
>
>  - Emmanuel
>
>
>Alberto Massari wrote:
> > Hi Emmanuel,
> > the NetAccessor modules that Xerces-C++ include don't have support for
> > proxy servers; if you are on Windows you can try getting the code
> > attached to bug#692 (http://issues.apache.org/jira/browse/XERCESC-692)
> > and building a custom version of Xerces that uses WinInet (that should
> > pick the proxy settings used by Internet Explorer)
> >
> > Hope this helps,
> > Alberto
> >
> > At 15.05 06/07/2007 +0200, Emmanuel Guiton wrote:
> >> Hello,
> >>
> >> I am working on an application which needs to perform XML validation
> >> against a schema which includes online references. E.g.
> >> <xs:import namespace="http://www.w3.org/2000/09/xmldsig#"
> >> 
> schemaLocation="http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd"/>
> >>
> >>
> >>
> >> The problem is that there is a proxy between Xerces and the outside
> >> world. So far, Xerces fails to access the external schema. What must we
> >> do in order to make Xerces use the proxy to fetch the external schema ?
> >>
> >> I saw in the FAQ that using Xerces-j one "must  set the two
> >> system properties: "http.proxyHost" and "http.proxyPort" ". Is there any
> >> equivalent in Xerces-c ?
> >>
> >> Thanks for any help,
> >>  - Emmanuel
> >>
> >> --
> >> Directeur
> >> Elodig SARL
> >> 30-32, avenue de la République
> >> 94800 Villejuif
> >> Tel:    01 46 77 47 68
> >> E-mail: emmanuel.guiton@elodig.fr
> >> http://www.elodig.fr
> >
> >
> >
>
>--
>Directeur
>Elodig SARL
>30-32, avenue de la République
>94800 Villejuif
>Tel:    01 46 77 47 68
>E-mail: emmanuel.guiton@elodig.fr
>http://www.elodig.fr


Re: External schema validation using Xerces from behind a proxy

Posted by Emmanuel Guiton <em...@elodig.fr>.
Hi Alberto,

Thanks a lot for the tip.

Unfortunately, we are working on Linux machines and I must admit I would
prefer a lighter solution.
Has anyone else already encountered and solved this issue in a different
way?

 - Emmanuel


Alberto Massari wrote:
> Hi Emmanuel,
> the NetAccessor modules that Xerces-C++ include don't have support for
> proxy servers; if you are on Windows you can try getting the code
> attached to bug#692 (http://issues.apache.org/jira/browse/XERCESC-692)
> and building a custom version of Xerces that uses WinInet (that should
> pick the proxy settings used by Internet Explorer)
> 
> Hope this helps,
> Alberto
> 
> At 15.05 06/07/2007 +0200, Emmanuel Guiton wrote:
>> Hello,
>>
>> I am working on an application which needs to perform XML validation
>> against a schema which includes online references. E.g.
>> <xs:import namespace="http://www.w3.org/2000/09/xmldsig#"
>> schemaLocation="http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd"/>
>>
>>
>>
>> The problem is that there is a proxy between Xerces and the outside
>> world. So far, Xerces fails to access the external schema. What must we
>> do in order to make Xerces use the proxy to fetch the external schema ?
>>
>> I saw in the FAQ that using Xerces-j one "must  set the two
>> system properties: "http.proxyHost" and "http.proxyPort" ". Is there any
>> equivalent in Xerces-c ?
>>
>> Thanks for any help,
>>  - Emmanuel
>>
>> -- 
>> Directeur
>> Elodig SARL
>> 30-32, avenue de la République
>> 94800 Villejuif
>> Tel:    01 46 77 47 68
>> E-mail: emmanuel.guiton@elodig.fr
>> http://www.elodig.fr
> 
> 
> 

-- 
Directeur
Elodig SARL
30-32, avenue de la République
94800 Villejuif
Tel:    01 46 77 47 68
E-mail: emmanuel.guiton@elodig.fr
http://www.elodig.fr

Re: External schema validation using Xerces from behind a proxy

Posted by Alberto Massari <am...@datadirect.com>.
Hi Emmanuel,
the NetAccessor modules that Xerces-C++ include 
don't have support for proxy servers; if you are 
on Windows you can try getting the code attached 
to bug#692 
(http://issues.apache.org/jira/browse/XERCESC-692) 
and building a custom version of Xerces that uses 
WinInet (that should pick the proxy settings used by Internet Explorer)

Hope this helps,
Alberto

At 15.05 06/07/2007 +0200, Emmanuel Guiton wrote:
>Hello,
>
>I am working on an application which needs to perform XML validation
>against a schema which includes online references. E.g.
><xs:import namespace="http://www.w3.org/2000/09/xmldsig#"
>schemaLocation="http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd"/>
>
>
>The problem is that there is a proxy between Xerces and the outside
>world. So far, Xerces fails to access the external schema. What must we
>do in order to make Xerces use the proxy to fetch the external schema ?
>
>I saw in the FAQ that using Xerces-j one "must  set the two
>system properties: "http.proxyHost" and "http.proxyPort" ". Is there any
>equivalent in Xerces-c ?
>
>Thanks for any help,
>  - Emmanuel
>
>--
>Directeur
>Elodig SARL
>30-32, avenue de la République
>94800 Villejuif
>Tel:    01 46 77 47 68
>E-mail: emmanuel.guiton@elodig.fr
>http://www.elodig.fr