You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-dev@xml.apache.org by James Bates <ja...@amplexor.com> on 2002/05/11 20:14:34 UTC

RE: XML/RPC problem => HTTP server

Guys, another indication of my belief that Xindice oughtn't to maintain an HTTP server. Many fine people already do so...
 
Could we start thinking about hooking our web-services (only XML-RPC left now, plus maybe a webdav interface... which IS a servlet already) into the Java servlet architecture? If not,
Apache XML-RPC already contains an embedded HTTP server that could be used, as at the core level, ít's the only HTTP needed.
 
James

	-----Original Message----- 
	From: Jonathan Mark [mailto:jhmark@xenops.com] 
	Sent: Thu 5/9/2002 11:56 PM 
	To: xindice-dev@xml.apache.org 
	Cc: 
	Subject: Re: XML/RPC problem
	
	

	hello Xindice developers,
	
	I didn't receive a reply to my message about XML/RPC buffering, so I
	debugged it.
	The problem is in org/apache/xindice/server/services/HTTPServer.java,
	line 434, where this line:
	                        dis.read(postdata);
	should be this:
	                        dis.readFully(postdata);
	
	This causes Xindice's HTTP server sometimes not to read the entire request
	body.
	The other call to dis.read() needs to be changed also.
	I'll submit a proper patch when I've had a chance to test both cases.
	
	thanks,
	
	        Jonathan
	
	On Fri, 3 May 2002, Jonathan Mark wrote:
	> hi ...
	>
	> I am noticing a problem where some valid XUpdate's fail when sent over
	> XML/RPC to Xindice.  By making a trivial change to the update (deleting
	> some lines of non-markup text) I can always make it succeed.
	>
	> The failing update is attached as update.xml.  When I send this update
	> over XML/RPC, the client receives "500 Connection reset by peer" and the
	> Xindice server emits the following message:
	>
	> Fatal error parsing XML: org.xml.sax.SAXParseException: invalid Character
	> Entitiy
	>
	> (With other updates, I have also seen a message saying that an invalid
	> character 0 appeared in the input.)
	>
	> If lines 11 through 16 of update.xml are deleted (all but one of the lines
	> of "a"'s) then the update will succeed.
	> Either version of update.xml will succeed if I pass it via the Java
	> interface instead of XML/RPC.
	> The initial state of my database is defined by adding the attached
	> document "example.xml".
	>
	> I am wondering if there might be some sort of buffering problem in the way
	> updates are read from the XML/RPC interface.
	> Any help or suggestions would be appreciated.
	>
	> thanks,
	>
	>       Jonathan Mark
	>
	
	
	


RE: XML/RPC problem => HTTP server

Posted by "Imran S. Patel" <im...@cs.ucsb.edu>.
hi folks, 

I also had a related problem sometimes back when I was using XML-RPC API
to send a large document using the setDocument or insertDocument method.
The XML-RPC server used to throw an exception like "encountered NULL
character in XML document". My guess is that the HTTP server never read
the data in its entirety and passed the "chunks" to the XML-RPC API which
then found it invalid while parsing. Also, this happened only for
large document (= large HTTP requests). Hope to see a patch soon.

imran


On Sat, 11 May 2002, James Bates wrote:

> Guys, another indication of my belief that Xindice oughtn't to maintain an HTTP server. Many fine people already do so...
>  
> Could we start thinking about hooking our web-services (only XML-RPC left now, plus maybe a webdav interface... which IS a servlet already) into the Java servlet architecture? If not,
> Apache XML-RPC already contains an embedded HTTP server that could be used, as at the core level, ít's the only HTTP needed.
>  
> James
> 
> 	-----Original Message----- 
> 	From: Jonathan Mark [mailto:jhmark@xenops.com] 
> 	Sent: Thu 5/9/2002 11:56 PM 
> 	To: xindice-dev@xml.apache.org 
> 	Cc: 
> 	Subject: Re: XML/RPC problem
> 	
> 	
> 
> 	hello Xindice developers,
> 	
> 	I didn't receive a reply to my message about XML/RPC buffering, so I
> 	debugged it.
> 	The problem is in org/apache/xindice/server/services/HTTPServer.java,
> 	line 434, where this line:
> 	                        dis.read(postdata);
> 	should be this:
> 	                        dis.readFully(postdata);
> 	
> 	This causes Xindice's HTTP server sometimes not to read the entire request
> 	body.
> 	The other call to dis.read() needs to be changed also.
> 	I'll submit a proper patch when I've had a chance to test both cases.
> 	
> 	thanks,
> 	
> 	        Jonathan
> 	
> 	On Fri, 3 May 2002, Jonathan Mark wrote:
> 	> hi ...
> 	>
> 	> I am noticing a problem where some valid XUpdate's fail when sent over
> 	> XML/RPC to Xindice.  By making a trivial change to the update (deleting
> 	> some lines of non-markup text) I can always make it succeed.
> 	>
> 	> The failing update is attached as update.xml.  When I send this update
> 	> over XML/RPC, the client receives "500 Connection reset by peer" and the
> 	> Xindice server emits the following message:
> 	>
> 	> Fatal error parsing XML: org.xml.sax.SAXParseException: invalid Character
> 	> Entitiy
> 	>
> 	> (With other updates, I have also seen a message saying that an invalid
> 	> character 0 appeared in the input.)
> 	>
> 	> If lines 11 through 16 of update.xml are deleted (all but one of the lines
> 	> of "a"'s) then the update will succeed.
> 	> Either version of update.xml will succeed if I pass it via the Java
> 	> interface instead of XML/RPC.
> 	> The initial state of my database is defined by adding the attached
> 	> document "example.xml".
> 	>
> 	> I am wondering if there might be some sort of buffering problem in the way
> 	> updates are read from the XML/RPC interface.
> 	> Any help or suggestions would be appreciated.
> 	>
> 	> thanks,
> 	>
> 	>       Jonathan Mark
> 	>
> 	
> 	
> 	
> 
> 


Re: XML/RPC problem => HTTP server

Posted by Kimbro Staken <ks...@xmldatabases.org>.
On Saturday, May 11, 2002, at 11:14 AM, James Bates wrote:

> Guys, another indication of my belief that Xindice oughtn't to maintain 
> an HTTP server. Many fine people already do so...
>  
I agree completely, the more code we can get off our plate the better.

> Could we start thinking about hooking our web-services (only XML-RPC left 
> now, plus maybe a webdav interface... which IS a servlet already) into 
> the Java servlet architecture? If not,
>
I proposed something like this a couple months ago, but I think it got 
lost in another thread as no one commented. To me I think it makes a lot 
of sense. What are the reasons not to do this?

> Apache XML-RPC already contains an embedded HTTP server that could be 
> used, as at the core level, ít's the only HTTP needed.
>  
> James
>
> -----Original Message-----
> From: Jonathan Mark [mailto:jhmark@xenops.com]
> Sent: Thu 5/9/2002 11:56 PM
> To: xindice-dev@xml.apache.org
> Cc:
> Subject: Re: XML/RPC problem
>
> hello Xindice developers,
>
> I didn't receive a reply to my message about XML/RPC buffering, so I
> debugged it.
> The problem is in org/apache/xindice/server/services/HTTPServer.java,
> line 434, where this line:
>                         dis.read(postdata);
> should be this:
>                         dis.readFully(postdata);
>
> This causes Xindice's HTTP server sometimes not to read the entire request
> body.
> The other call to dis.read() needs to be changed also.
> I'll submit a proper patch when I've had a chance to test both cases.
>
> thanks,
>
>         Jonathan
>
> On Fri, 3 May 2002, Jonathan Mark wrote:
> > hi ...
> >
> > I am noticing a problem where some valid XUpdate's fail when sent over
> > XML/RPC to Xindice.  By making a trivial change to the update (deleting
> > some lines of non-markup text) I can always make it succeed.
> >
> > The failing update is attached as update.xml.  When I send this update
> > over XML/RPC, the client receives "500 Connection reset by peer" and the
> > Xindice server emits the following message:
> >
> > Fatal error parsing XML: org.xml.sax.SAXParseException: invalid 
> Character
> > Entitiy
> >
> > (With other updates, I have also seen a message saying that an invalid
> > character 0 appeared in the input.)
> >
> > If lines 11 through 16 of update.xml are deleted (all but one of the 
> lines
> > of "a"'s) then the update will succeed.
> > Either version of update.xml will succeed if I pass it via the Java
> > interface instead of XML/RPC.
> > The initial state of my database is defined by adding the attached
> > document "example.xml".
> >
> > I am wondering if there might be some sort of buffering problem in the 
> way
> > updates are read from the XML/RPC interface.
> > Any help or suggestions would be appreciated.
> >
> > thanks,
> >
> >       Jonathan Mark
> >
>
>
>
Kimbro Staken
Java and XML Software, Consulting and Writing http://www.xmldatabases.org/
Apache Xindice native XML database http://xml.apache.org/xindice
XML:DB Initiative http://www.xmldb.org