You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Rahul Jain <ra...@jtcsv.com> on 2000/07/07 18:23:28 UTC

Re: WinSockNetAccessor

Sorry for the delay in this response. I was tied up with a different
task.

The current implementation uses a very straightforward / simplistic
exchange to retrieve a file from a WebServer. I tested it only against
the Apache server. All that is involved is to make a socket connection
to the specified / default port. Once connection is established, it
writes to the following to the socket:
    "GET http://localhost/xerces.xml\n\n"
After that its just a matter of reading bytes from the socket.

Try this with the IIS server:
    telnet localhost 80
You should see a new blank telnet window screen. Next type exactly
the above quote command to get the file. If that does not
work, then you know that, IIS is expecting some additional information
for the GET command to work.

Any changes are welcome. Please send them to the xerces-c-dev@xml.apache.org
mailing list.

rahul




----- Original Message ----- 
From: "Fritchman, Barry L" <Ba...@unisys.com>
To: <ra...@jtcsv.com>
Sent: Thursday, July 06, 2000 12:52 AM
Subject: WinSockNetAccessor


> Rahul,
> 
> I posted the following item to the xerces c++ mailing list about a week ago,
> but no one seemed to know much about it.  As I understand it, you are the
> author of the WinSockNetAccessor class, so I thought maybe you would have
> some ideas about this.  Since my original post, I have tried it with a
> couple of additional web servers, and I have found that it works ok with
> Jigsaw, but fails with Microsoft Personal WebServer and JavaServer Web
> Development Kit.  I'm trying to find someone who has IIS to test it with
> that, but haven't been able to yet.  What I'm trying to do is extract XML
> from a SQLServer 2000 database (which requires use of one of the MS web
> servers) directly into the SAX parser via a URLInputSource.
> 
> Thanks,
> Barry
> 
> 
> I'm trying to do a nonvalidating parse using SAXParser and a URLInputSource.
> I can parse an XML file as a LocalFileInputSource, and everything is fine
> there.  But when I use a URLInputSource to specify the exact same document,
> I get the message "Fatal Error: Invalid document structure.".  Relevant
> details are given below.  One thing I noticed is that if I give an incorrect
> URL, e.g., pointing to a file that doesn't exist, I get the same message.
> However, I know the URL is correct as given below, because I used it in my
> browser and got the file back.
> 
>     .
>     .
>     .
>     // The following file path and URL reference the same file.
>     //
>     const wchar_t* const XML_DOCUMENT =
> L"c:\\javalibs\\jswdk-1.0.1\\webpages\\xerces.xml";
>     const wchar_t* const XML_URL_STRING = L"http://localhost/xerces.xml";
> 
>     // This parse is successful.
>     //
>     LocalFileInputSource fileInputSource(XML_DOCUMENT);
>     parser.parse(fileInputSource);
> 
>     // This parse of the same document via a URL fails with "Fatal Error:
> Invalid document structure.".
>     //
>     XMLURL url(XML_URL_STRING);
>     URLInputSource urlInputSource(url);
>     parser.parse(urlInputSource);
> 
> 
> Xerces release:  1.2.0
> OS:                   Windows NT 4.0, SP5
> Compiler:           MS VC++ 6.0 (used only to compile my app, using original
> xerces binaries)
> 
> 
> The XML document I used is:
> 
> <?xml version='1.0' encoding='ascii'?>
> <!DOCTYPE company [
> <!ELEMENT company     (product,category,developedAt)>
> <!ELEMENT product     (#PCDATA)>
> <!ELEMENT category    (#PCDATA)>
> <!ATTLIST category idea CDATA #IMPLIED>
> <!ELEMENT developedAt (#PCDATA)>
> ]>
> <company>
>     <product>XML4C</product>
>     <category idea='great'>XML Parsing Tools</category>
>     <developedAt>
>       IBM Center for Java Technology, Silicon Valley, Cupertino, CA
>     </developedAt>
> </company>
> 
> 
> 
> 


Re: WinSockNetAccessor

Posted by Jon Smirl <jo...@mediaone.net>.
It probably needs to protocol version to work right otherwise it defaults to
version 0.9.

GET http://localhost/xerces.xml HTTP/1.0\n\n

Could Xerces link to ws2-32.lib instead of winsock.lib?

Jon Smirl
jonsmirl@mediaone.net



Re: WinSockNetAccessor

Posted by Dean Roddey <dr...@charmedquark.com>.
The other issue is, are you skipping over the HTML header lines, i.e.
skipping to the first line after the empty line?

--------------------------
Dean Roddey
The CIDLib C++ Frameworks
Charmed Quark Software
droddey@charmedquark.com
http://www.charmedquark.com

"You young, and you gotcha health. Whatchoo wanna job fer?"


----- Original Message -----
From: "Rahul Jain" <ra...@jtcsv.com>
To: "Fritchman, Barry L" <Ba...@unisys.com>
Cc: "xerces-c-dev" <xe...@xml.apache.org>
Sent: Friday, July 07, 2000 9:23 AM
Subject: Re: WinSockNetAccessor


> Sorry for the delay in this response. I was tied up with a different
> task.
>
> The current implementation uses a very straightforward / simplistic
> exchange to retrieve a file from a WebServer. I tested it only against
> the Apache server. All that is involved is to make a socket connection
> to the specified / default port. Once connection is established, it
> writes to the following to the socket:
>     "GET http://localhost/xerces.xml\n\n"
> After that its just a matter of reading bytes from the socket.
>
> Try this with the IIS server:
>     telnet localhost 80
> You should see a new blank telnet window screen. Next type exactly
> the above quote command to get the file. If that does not
> work, then you know that, IIS is expecting some additional information
> for the GET command to work.
>
> Any changes are welcome. Please send them to the
xerces-c-dev@xml.apache.org
> mailing list.
>
> rahul
>
>
>
>
> ----- Original Message -----
> From: "Fritchman, Barry L" <Ba...@unisys.com>
> To: <ra...@jtcsv.com>
> Sent: Thursday, July 06, 2000 12:52 AM
> Subject: WinSockNetAccessor
>
>
> > Rahul,
> >
> > I posted the following item to the xerces c++ mailing list about a week
ago,
> > but no one seemed to know much about it.  As I understand it, you are
the
> > author of the WinSockNetAccessor class, so I thought maybe you would
have
> > some ideas about this.  Since my original post, I have tried it with a
> > couple of additional web servers, and I have found that it works ok with
> > Jigsaw, but fails with Microsoft Personal WebServer and JavaServer Web
> > Development Kit.  I'm trying to find someone who has IIS to test it with
> > that, but haven't been able to yet.  What I'm trying to do is extract
XML
> > from a SQLServer 2000 database (which requires use of one of the MS web
> > servers) directly into the SAX parser via a URLInputSource.
> >
> > Thanks,
> > Barry
> >
> >
> > I'm trying to do a nonvalidating parse using SAXParser and a
URLInputSource.
> > I can parse an XML file as a LocalFileInputSource, and everything is
fine
> > there.  But when I use a URLInputSource to specify the exact same
document,
> > I get the message "Fatal Error: Invalid document structure.".  Relevant
> > details are given below.  One thing I noticed is that if I give an
incorrect
> > URL, e.g., pointing to a file that doesn't exist, I get the same
message.
> > However, I know the URL is correct as given below, because I used it in
my
> > browser and got the file back.
> >
> >     .
> >     .
> >     .
> >     // The following file path and URL reference the same file.
> >     //
> >     const wchar_t* const XML_DOCUMENT =
> > L"c:\\javalibs\\jswdk-1.0.1\\webpages\\xerces.xml";
> >     const wchar_t* const XML_URL_STRING =
L"http://localhost/xerces.xml";
> >
> >     // This parse is successful.
> >     //
> >     LocalFileInputSource fileInputSource(XML_DOCUMENT);
> >     parser.parse(fileInputSource);
> >
> >     // This parse of the same document via a URL fails with "Fatal
Error:
> > Invalid document structure.".
> >     //
> >     XMLURL url(XML_URL_STRING);
> >     URLInputSource urlInputSource(url);
> >     parser.parse(urlInputSource);
> >
> >
> > Xerces release:  1.2.0
> > OS:                   Windows NT 4.0, SP5
> > Compiler:           MS VC++ 6.0 (used only to compile my app, using
original
> > xerces binaries)
> >
> >
> > The XML document I used is:
> >
> > <?xml version='1.0' encoding='ascii'?>
> > <!DOCTYPE company [
> > <!ELEMENT company     (product,category,developedAt)>
> > <!ELEMENT product     (#PCDATA)>
> > <!ELEMENT category    (#PCDATA)>
> > <!ATTLIST category idea CDATA #IMPLIED>
> > <!ELEMENT developedAt (#PCDATA)>
> > ]>
> > <company>
> >     <product>XML4C</product>
> >     <category idea='great'>XML Parsing Tools</category>
> >     <developedAt>
> >       IBM Center for Java Technology, Silicon Valley, Cupertino, CA
> >     </developedAt>
> > </company>
> >
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
>