dmay / xmlrpcnet

Automatically exported from code.google.com/p/xmlrpcnet
0 stars 0 forks source link

Value of field Content-Length in HTTP Header is always 0 (zero) #19

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I am using the library for communicating with industrial devices. Both have
a server and a client part. To be independant of an IIS or .Net Remoting I
implemented my server part using the XmlRpcListener class of the library 2.2.0.

The output of an request is o.k. instead that the value of content-length
in the HTTP header is always 0 (zero). The content length must be set
according to the xml-rpc specification. Also the clients do not accept the
responses with this header.

The value cannot be set in my class because:
1. content-length must be set BEFORE writing to the outputstream. Means
before the XmlRpcHttpServerProtocol class invokes Util.CopyStream();
2. RequestContext.Reponse.OutputStream is not seekable. That means it will
throw a "NotSupported exception" if you call get_length() on the stream.

At the moment I have made a workaround. I added a public field of type
HttpListenerContext to the XmlRpcHttpServerProtocol class. Then I can set
the contentLength property of the response just before the
Util.CopyStream() call.

Original issue reported on code.google.com by froori...@gmail.com on 31 Mar 2008 at 4:55

GoogleCodeExporter commented 9 years ago
Fixed in revision 38. Responses from XmlRpcListenerService will by default set 
the
ContentLength response header. Set the SendChunked property of 
XmlRpcListenerService
to send chunked content.

Original comment by ChasC...@gmail.com on 2 Apr 2008 at 9:54

GoogleCodeExporter commented 9 years ago

Original comment by ChasC...@gmail.com on 2 Apr 2008 at 9:57

GoogleCodeExporter commented 9 years ago
Chunked ,essages is a feature of HTTP Version 1.1. But XML-RPC is only 
specified for
HTTP 1.0. I have clients which cannot handle chunked messages. 

So I cannot send chunked content.

Original comment by froori...@gmail.com on 2 Apr 2008 at 11:27

GoogleCodeExporter commented 9 years ago
Sorry I misunderstood your post. I had a look at rev38. Should work fine.

Original comment by froori...@gmail.com on 2 Apr 2008 at 11:45