[xsd-users] http://www.w3.org/2003/05/soap-envelope/

Boris Kolpackov boris at codesynthesis.com
Fri Nov 14 12:18:56 EST 2008


Hi Mirko,

I've CC'ed xsd-users mailing list to my reply in case someone
runs into a similar problem.

Mirko Kohns <mirko.kohns at gmail.com> writes:

> xml_schema::namespace_infomap map;
> map[""].name="";
> map[""].schema="soap-envelope.xsd";

You probably want this to be:

map[""].name="http://www.w3.org/2003/05/soap-envelope";
map[""].schema="soap-envelope.xsd";

Or, if you want the output to look more similar to the original:

map["soapenv"].name="http://www.w3.org/2003/05/soap-envelope";
map["soapenv"].schema="soap-envelope.xsd";


> My Problem is .. that the programm stops with the line "Parsing file
> ..." and never returns. With your "email.xsd" example it works fine.
> So I thougt it would be a problem with the soap xsd stuff.
> I attached gdb to the stuck application and got this backtrace
> 
> #2  0xb7e3d58e in xercesc_2_7::UnixHTTPURLInputStream::UnixHTTPURLInputStream

Here is what happens: the underlying XML parser (Xerces-C++) tries
to validate the XML document using the soap-envelope.xsd schema.
This schema includes xml.xsd from a remote location. So the parser
tries to download it (that's why there is HTTPURL in the stack trace).
I tried to run your test case as is and it works fine except for a 
delay caused by the downloading of the schema. There are several 
ways how you can address this:

1. Disable XML Schema validation if you don't need it by passing
   xml_schema::flags::dont_validate to the parsing function.

2. Change soap-envelope.xsd to use local copy of xml.xsd (i.e.,
   change http://www.w3.org/2001/xml.xsd to xml.xsd in the
   schemaLocation attribute).

3. Pre-load the schemas in the right order yourself. If you load 
   xml.xsd first (from a local copy) and then soap-envelope.xsd
   then the remote location will be ignored since the file is
   already loaded. For more information on how to pre-load the
   schemas see the 'caching' example.

Boris




More information about the xsd-users mailing list