On Friday, August 12, 2011 6:11:21 PM Rovinson, William wrote: > Hi, > > I'm using Apache CXF 2.3.3 version for creating the Web Service client > using JAX-WS. When I sent a request the Transfer-Encoding is not set to > chunked. As per user guide it supposed to be chunked by default. > When I sent a request, I'm getting "Read timed out" error, but its > working well with other web service framework(axis).... > Please help me to resolve this issue....
If you see, there is a content-length: > Content-Length: 4072 so it shouldn't have chunking for the message. Basically, with chunking, there is a buffer that is maintained and when the buffer fills, the buffer is flushed out. With CXF, we have a slight optimization in that if end of the message is hit before the first buffer is filled, since we know the entire size, we can just set the content-length header and send the entire request rather than chunk it. For small requests, that actually performs slightly better as it's one less network packet per message. See the description of ChunkingThreshold at: http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html where you can configure that. The default is 4K (4096) so your message is JUST under the threshold. Dan > Thanks in advance. > > More details follows, > Software: Apache CXF 2.3.3 > Platform: IBM WebSphere v6.1 > > Message header looks like, > POST /NE3S/1.0/NE3SRegistrationService HTTP/1.1 > Content-Type: multipart/related; type="text/xml"; > boundary="uuid:5e281659-4654-4ca3-b469-da49b24d1b32"; > start="<[email protected]>"; start-info="text/xml" > SOAPAction: "http://www.nokiasiemens.com/ne3s/1.0/startRegistration" > Authorization: Basic c29hcHN1bTp3YXN1c3I= > Accept: */* > User-Agent: Apache CXF 2.3.3 > Cache-Control: no-cache > Pragma: no-cache > Host: 10.9.115.121:60000 > Connection: keep-alive > Content-Length: 4072 > > I'm not sure the below error is because of not set to chunk..... > [8/10/11 10:00:01:335 IST] 00000021 PhaseIntercep W > org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging Interceptor > for > {http://www.nokiasiemens.com/ne3s/1.0}NE3SRegistrationService#{http://ww > w.nokiasiemens.com/ne3s/1.0}startRegistration > <http://www.nokiasiemens.com/ne3s/1.0%7dNE3SRegistrationService> has > thrown exception, unwinding now > org.apache.cxf.interceptor.Fault: Could not send Message. > at > org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingI > nterceptor.handleMessage(MessageSenderInterceptor.java:64) > at > org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorC > hain.java:255) > at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516) > at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313) > at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265) > at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) > at > org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124) > at $Proxy49.startRegistration(Unknown Source) > at com.nsn.oss.ne3s.client.Operation.register(Operation.java:111) > at com.nsn.oss.ne3s.client.Operation.startSession(Operation.java:158) > at com.nsn.oss.ne3s.client.Operation.upload(Operation.java:231) > at > com.nsn.oss.ne3s.ejb.NE3SWSEJBSession.executeOperation(NE3SWSEJBSession. > java:75) > at > com.nsn.oss.ne3s.ejb.EJSRemoteStatelessMyNE3SWSEJB_d5f647c1.executeOpera > tion(Unknown Source) > at > com.nsn.oss.ne3s.ejb._EJSRemoteStatelessMyNE3SWSEJB_d5f647c1_Tie.execute > Operation(_EJSRemoteStatelessMyNE3SWSEJB_d5f647c1_Tie.java:161) > at > com.nsn.oss.ne3s.ejb._EJSRemoteStatelessMyNE3SWSEJB_d5f647c1_Tie._invoke > (_EJSRemoteStatelessMyNE3SWSEJB_d5f647c1_Tie.java:104) > at > com.ibm.CORBA.iiop.ServerDelegate.dispatchInvokeHandler(ServerDelegate.j > ava:621) > at com.ibm.CORBA.iiop.ServerDelegate.dispatch(ServerDelegate.java:474) > at com.ibm.rmi.iiop.ORB.process(ORB.java:503) > at com.ibm.CORBA.iiop.ORB.process(ORB.java:1571) > at com.ibm.rmi.iiop.Connection.respondTo(Connection.java:2703) > at com.ibm.rmi.iiop.Connection.doWork(Connection.java:2577) > at com.ibm.rmi.iiop.WorkUnitImpl.doWork(WorkUnitImpl.java:62) > at com.ibm.ejs.oa.pool.PooledThread.run(ThreadPool.java:118) > at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473) > Caused by: java.net.SocketTimeoutException: SocketTimeoutException > invoking http://10.9.115.121:60000/NE3S/1.0/NE3SRegistrationService: > Read timed out > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) > at > sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorA > ccessorImpl.java:67) > at > sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons > tructorAccessorImpl.java:45) > at java.lang.reflect.Constructor.newInstance(Constructor.java:522) > at > org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.mapExcepti > on(HTTPConduit.java:2107) > at > org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTP > Conduit.java:2092) > at > org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) > at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:697) > at > org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingI > nterceptor.handleMessage(MessageSenderInterceptor.java:62) > ... 23 more > Caused by: java.net.SocketTimeoutException: Read timed out > at java.net.SocketInputStream.socketRead0(Native Method) > at java.net.SocketInputStream.read(SocketInputStream.java:155) > at java.io.BufferedInputStream.fill(BufferedInputStream.java:229) > at java.io.BufferedInputStream.read1(BufferedInputStream.java:267) > at java.io.BufferedInputStream.read(BufferedInputStream.java:324) > at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:658) > at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:607) > at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:734) > at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:607) > at > sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnec > tion.java:966) > at > java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:379) > at > org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResp > onseInternal(HTTPConduit.java:2224) > at > org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResp > onse(HTTPConduit.java:2193) > at > org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTP > Conduit.java:2037) > ... 26 more > > > Regards, > William -- Daniel Kulp [email protected] http://dankulp.com/blog Talend - http://www.talend.com
