Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C770D9B7D for ; Wed, 4 Apr 2012 19:28:36 +0000 (UTC) Received: (qmail 19800 invoked by uid 500); 4 Apr 2012 19:28:36 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 19777 invoked by uid 500); 4 Apr 2012 19:28:36 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 19767 invoked by uid 99); 4 Apr 2012 19:28:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Apr 2012 19:28:36 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: 216.139.236.26 is neither permitted nor denied by domain of ss.engineering2000@gmail.com) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Apr 2012 19:28:30 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1SFVsH-0003PC-9U for issues@cxf.apache.org; Wed, 04 Apr 2012 12:28:09 -0700 Date: Wed, 4 Apr 2012 12:28:09 -0700 (PDT) From: ss_eng2000 To: issues@cxf.apache.org Message-ID: <1333567689285-5618816.post@n5.nabble.com> Subject: cxf-client: how to use a fresh http connection for multiple soap calls MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi, I am using a generated java cxf-client to make multiple soap calls to a soap server. This is done in the same thread. I'm running into an error where the second soap call made on a keepAlive http connection always fails. It looks like cxf is using the same underlying http connection to make the multiple calls within the same thread. Is that to be expected? How can I make my cxf-client create a fresh http connection for each soap call? If I configure the soap server to not use the keepAlive connection, sending of multiple soap calls work. I do not want to launch this way. I also experimented with creating the javax.xml.ws.Service every time I need to create a send a soap request. That still results in the same error on the second soap request. Note: this works on my personal environment (macosx 10.6.8) and not in other linux environments. thanks. -S Stack Trace: org.apache.cxf.interceptor.Fault: Could not send Message. at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263) at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:533) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:463) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:366) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:319) at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:88) at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:134) at $Proxy71.shoppingCartProductRemove(Unknown Source) at com.lockerz.catalog.service.CatalogServiceMagentoImpl$1.doSpecifics(CatalogServiceMagentoImpl.java:144) at com.lockerz.catalog.service.CatalogServiceMagentoImpl.executeSoap(CatalogServiceMagentoImpl.java:235) at com.lockerz.catalog.service.CatalogServiceMagentoImpl.deleteItemsInCart(CatalogServiceMagentoImpl.java:140) at com.lockerz.order.queue.CatalogUpdatorWorker$2.doInTransaction(CatalogUpdatorWorker.java:105) at com.lockerz.order.queue.CatalogUpdatorWorker$2.doInTransaction(CatalogUpdatorWorker.java:88) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130) at com.lockerz.order.queue.CatalogUpdatorWorker.run(CatalogUpdatorWorker.java:88) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: java.net.SocketException: SocketException invoking http://magento-int.lockerz.us/index.php/api/v2_soap/index/: Unexpected end of file from server at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.mapException(HTTPConduit.java:1431) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1416) at org.apache.cxf.io.CacheAndWriteOutputStream.postClose(CacheAndWriteOutputStream.java:47) at org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:195) at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:649) at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) ... 21 more Caused by: java.net.SocketException: Unexpected end of file from server at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:781) at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:640) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1195) at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:379) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1542) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1494) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1402) -- View this message in context: http://cxf.547215.n5.nabble.com/cxf-client-how-to-use-a-fresh-http-connection-for-multiple-soap-calls-tp5618816p5618816.html Sent from the cxf-issues mailing list archive at Nabble.com.