On Sun, 2012-04-22 at 16:09 +0530, Kishanthan Thangarajah wrote: > Hi All, > We are in the process of supporting httpclient4 in axis2 [1] along with > httpclient3 implementation. Since most of the httpclient4 implementations > are new from 3, we have some questions on proceeding with it. With > httpcleint 3, we used RequestEntity class in creating a Request entity > which will be used in wrapping the axis2 message object. Then this will be > used by axis2 http sender in every request. With httpclient4, in getting > the same thing done, we are using HttpEntity. > But with HttpEntity, we have to implement getContent() method in getting > the request entity content. This method returns an InputStream. So what we > did was, return a ByteArrayInputStream of the message in the method impl. > (ie *return new ByteArrayInputStream(message.getBytes()*). But is this the > best way of handling this, method considering performance.? > We figured out this way by referring to some of the available impl of this > method, such as in ByteArrayEntity etc. > > Thanks, > Kishanthan. > > [1] https://issues.apache.org/jira/browse/AXIS2-4318
Kishanthan The HttpEntity interface is used to represent content body of both incoming and outgoing messages. As far as HTTP request messages on the client side are concerned only #writeTo method is actually used when writing the request content out to the underlying connection. One should provide the #getContent method for the sake of completeness but the implementation of this method will have no impact on performance of the Axis2 HTTP transport. Hope this helps Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
