You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Darryl Pentz <dj...@yahoo.com> on 2008/09/08 15:50:19 UTC

Piggybacking HTTP with binary protocol

Last time I mailed the list, I was inquiring about implementing a custom connector or something along those lines to support a binary protocol along with HTTP. This approach proved flawed for various reasons, if not virtually impossible to do with the connector, processor, handler architecture etc..

So the approach I was wanting to try next was to amend our in-house protocol slightly and include initial HTTP headers so as to make use of the standard Http11Processor etc and then continue (after initial servlet mapping) with the current binary protocol. My question is, is this possible using say a POST.... to then continue comms on the input and output streams using binary?

I have tried to implement this approach but any read I do from the input stream after the request is forwarded to the servlet service method, throws an EOFException, which I haven't quite figured out. I wrote a simple socket client that writes the POST, a host header, and a blank line, I then write 2 int's and a String, but I am unable to read the ints and the String from the input stream in the service method without encountering the EOFException.

Does anybody know what might cause this? I can't quite isolate any code within Tomcat that might be causing this issue.

- Darryl


      

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Piggybacking HTTP with binary protocol

Posted by Martin Gainty <mg...@hotmail.com>.
Darryl-

you're encountering a content-length restriction
one workaround is to transmit as a MTOM binary attachment
I believe the current hard-limit is 1GB for attachment size

http://wso2.org/library/264

complete guide is available at
http://ws.apache.org/axis2/1_0/mtom-guide.html

HTH
Martin 
______________________________________________ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. 


> Date: Mon, 8 Sep 2008 06:50:19 -0700
> From: djpentz@yahoo.com
> Subject: Piggybacking HTTP with binary protocol
> To: users@tomcat.apache.org
> 
> Last time I mailed the list, I was inquiring about implementing a custom connector or something along those lines to support a binary protocol along with HTTP. This approach proved flawed for various reasons, if not virtually impossible to do with the connector, processor, handler architecture etc..
> 
> So the approach I was wanting to try next was to amend our in-house protocol slightly and include initial HTTP headers so as to make use of the standard Http11Processor etc and then continue (after initial servlet mapping) with the current binary protocol. My question is, is this possible using say a POST.... to then continue comms on the input and output streams using binary?
> 
> I have tried to implement this approach but any read I do from the input stream after the request is forwarded to the servlet service method, throws an EOFException, which I haven't quite figured out. I wrote a simple socket client that writes the POST, a host header, and a blank line, I then write 2 int's and a String, but I am unable to read the ints and the String from the input stream in the service method without encountering the EOFException.
> 
> Does anybody know what might cause this? I can't quite isolate any code within Tomcat that might be causing this issue.
> 
> - Darryl
> 
> 
>       
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 

_________________________________________________________________
Get more out of the Web. Learn 10 hidden secrets of Windows Live.
http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008

Re: Piggybacking HTTP with binary protocol

Posted by Raymond Kroeker <ra...@raykroeker.com>.
Darryl,
    One thing I might suggest is instead of rolling your own http
client; is to use the http client from apache http://hc.apache.org.  I
use it myself for various projects including binary data transfer.  It
will let you focus on your protocol instead of having to implement
http.

    Raymond

On Mon, Sep 8, 2008 at 06:50, Darryl Pentz <dj...@yahoo.com> wrote:
> Last time I mailed the list, I was inquiring about implementing a custom connector or something along those lines to support a binary protocol along with HTTP. This approach proved flawed for various reasons, if not virtually impossible to do with the connector, processor, handler architecture etc..
>
> So the approach I was wanting to try next was to amend our in-house protocol slightly and include initial HTTP headers so as to make use of the standard Http11Processor etc and then continue (after initial servlet mapping) with the current binary protocol. My question is, is this possible using say a POST.... to then continue comms on the input and output streams using binary?
>
> I have tried to implement this approach but any read I do from the input stream after the request is forwarded to the servlet service method, throws an EOFException, which I haven't quite figured out. I wrote a simple socket client that writes the POST, a host header, and a blank line, I then write 2 int's and a String, but I am unable to read the ints and the String from the input stream in the service method without encountering the EOFException.
>
> Does anybody know what might cause this? I can't quite isolate any code within Tomcat that might be causing this issue.
>
> - Darryl
>
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>



-- 
---------------------------------------------------------
Raymond Kroeker

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org