[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XML over HTTP

  • From: David Brownell <db@E...>
  • To: "xml-dev@i..." <xml-dev@i...>
  • Date: Wed, 18 Nov 1998 18:35:59 -0800

xml over tcp
james anderson wrote:
> 
> Greetings;
> 
> I have a simple question.
> 
> What are people doing when they read xml 'over the wire'?. It would appear
> that the logical structure of an xml document (to wit
>   [1] document ::= prolog element Misc*
> ) is at odds with the protocol specified for things like a http put operation.

No it isn't; HTTP handles NNNN bytes of data, the XML document is MMMM 
characters long, one only needs to know the number of bytes to exchange
the stuff over HTTP.  It's encoded in HTTP message header fields, or else
implicitly by the end (EOF) of the particular message.


> For which a response from the recipient cannot come until after the operation
> is performed. As a consequence of which, the input socket remain open (being a
> two-way stream in order to write the response) after the object has been read.
> In which case EOF is not a useful hint that the document is complete.

This is the same problem anyone writing POST/PUT code deals with.  The
client must use one of several techniques to terminate the request entity;
the server uses one of them to terminate the response entity.  (This is
"entity" in the MIME sense, not the XML sense.)

	- Do a half-close after sending ... use shutdown() to tweak the
	  TCP code to report EOF on that side of the connection.

	- Content-Length: NNNN ... that is, recipient reads NNNN octets
	  and that signifies end of entity.  Both close() afterwards.

	- Content-Length: NNNN ... like above, but using one of the
	  various keepalive HTTP flavors (preferably HTTP/1.1 not
	  the earlier version).  So, no close() afterwards, normally.

	- HTTP/1.1 supports chunked data, delivered in counted chunks.
	  This is like setting Content-Length, except that you can
	  avoid buffering the whole entity (e.g. a 4 Mbyte file) by
	  sending it chunk-at-a-time.

HTTP is like _any_ normal RPC protocol in that it doesn't permit response
data to be sent before the request has been read in.  There are atomicity
issues. 

- Dave



> The same problem will appliy to connections which are kept alive for
> extended communications.
> 
> We could well assert a specific document structure, - for example prescribing
> miscellaneous content after the document element, but i'm wondering what the
> general W3 intent was.

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@i... the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)


  • References:

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.