Cameron,

What were the security settings you used on your IIS? In my
case it is necessary to turn off anonymous authentication,
for reasons unrelated to xerces.

You said you used WinInet code, but it's not clear from your
code snippet where you used it. I presume your wrote your own
input source class? That won't help much in my case, since
that would only allow xerces to read the initial xml file.
But if that file contains references to schema files via
the schemaLocation attribute, xerces will always use the
NetAccessor class to download the schema files. Which will
fail if the schema files reside on the same IIS server.

Anyway, I rewrote the Win32 NetAccessor code to use WinInet
API calls instead of WinSock API calls, and then I had no
more problems connecting to the IIS server. WinInet handles
all underlying authentication 'handshakes'. But I don't
want to copy & paste that code every time I update to a
new version of the xerces library. I think it should be
part of the distribution.

Maybe that's a question for the xerces gurus: Is there a
good reason why the Win32 NetAccessor has been written
with the WinSock API? Can it be rewritten using WinInet?

Regards,

Martin

> -----Original Message-----
> From: McKerral, Cameron [mailto:mckerrc1@;anz.com]
> Sent: 08 October 2002 01:51
> To: '[EMAIL PROTECTED]'
> Subject: RE: Impossible to download xml with xerces from 
> Microsoft IIS?
> 
> 
> Martin,
> 
> I have used Xerces to parse an XML Buffer which I have read 
> from an IIS
> server (using WinInet code - based on HeadDump.CPP sample in 
> the microsoft
> site) and have also been able to do an XML parse using Xerces 
> directly.  So
> the problem must be either with your permissions on your 
> webserver or a
> problem in your code.  Here is the segment of code using the 
> Xerces parse
> directly:
> 
>     parser = new SAXParser;
>     parser->setDocumentHandler(&handler);
>     parser->setErrorHandler(&handler);
>     parser->setValidationScheme(valScheme);
>     parser->setDoNamespaces(doNamespaces);
>     parser->setDoSchema(doSchema);
>     parser->setValidationSchemaFullChecking(schemaFullChecking);
> 
>       XMLURL *url = NULL;
>       URLInputSource *inputSrc = NULL;
> 
>       url = new XMLURL("http://localhost/test.xml";);
>       inputSrc = new URLInputSource(*url);
> 
>       parser->parse(*inputSrc);
> 
> hope this helps,
> Cam
> 
> -----Original Message-----
> From: Martin Sch�fer [mailto:Martin.Schaefer@;cadcorp.com]
> Sent: Tuesday, 8 October 2002 1:19 AM
> To: [EMAIL PROTECTED]
> Subject: Impossible to download xml with xerces from Microsoft IIS?
> 
> 
> Hi,
> 
> I have MS IIS installed on my machine and try to use xerces 
> to parse an xml
> document that is served by IIS.
> Judging from what I've seen in the debugger it seems that the 
> xerces request
> is always responded to by IIS with a "401 Unauthorized" 
> message. I tried out
> different Authentication methods in the IIS "Directory 
> Security" property
> tab, but I always get 401.
> 
> Is it impossible to get a correct response from IIS with 
> xerces? If not,
> what do I have to do to get the desired result?
> 
> Any help appreciated.
> 
> Regards,
> 
> Martin
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to