I have a service that call another service in other server throught a proxy. I want to use HTTPS protocol,but i get this error:
Unexpected end of file from server
This is My code:
org.apache.cxf.endpoint.Client proxy2 = ClientProxy.getClient(client);
HTTPConduit conduit = (HTTPConduit) proxy2.getConduit();
conduit.getClient().setProxyServerType (ProxyServerType.SOCKS);
TLSClientParameters tcp = new TLSClientParameters();
tcp.setDisableCNCheck(false);
tcp.setSecureSocketProtocol("SSL");
TrustManager[] trustManager=new TrustManager[] { new DummyTrustManager() };
tcp.setTrustManagers(trustManager);
conduit.setTlsClientParameters(tcp);
HTTPClientPolicy policy = new HTTPClientPolicy();
policy.setConnectionTimeout(timeout);
policy.setReceiveTimeout(timeout);
conduit.setClient(policy);
String port = System.getProperty("ProxyPort");
System.setProperty("https.proxyHost", System.getProperty("ProxyServer"));
System.setProperty("https.proxyPort", port);
conduit.getClient().setProxyServer(System.getProperty("ProxyServer"));
if(StringUtils.isNumeric(port)) {
conduit.getClient().setProxyServerPort(Integer.valueOf(port));
}
conduit.getProxyAuthorization().setUserName(System.getProperty("ProxyUser"));
conduit.getProxyAuthorization().setPassword(System.getProperty("ProxyPwd"));
response = client.callService(request);
This is the log output:
org.apache.cxf.binding.soap.SoapFault: Problem writing SAAJ model to stream: Unexpected end of file from server at org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor$SAAJOutEndingInterceptor.handleMessage(SAAJOutInterceptor.java:224) ~[cxf-rt-bindings-soap-3.1.8.jar:3.1.8] at org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor$SAAJOutEndingInterceptor.handleMessage(SAAJOutInterceptor.java:174) ~[cxf-rt-bindings-soap-3.1.8.jar:3.1.8] at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) [cxf-core-3.1.8.jar:3.1.8] at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:514) [cxf-core-3.1.8.jar:3.1.8] at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:423) [cxf-core-3.1.8.jar:3.1.8] at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:324) [cxf-core-3.1.8.jar:3.1.8] at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:277) [cxf-core-3.1.8.jar:3.1.8] at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96) [cxf-rt-frontend-simple-3.1.8.jar:3.1.8] at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:139) [cxf-rt-frontend-jaxws-3.1.8.jar:3.1.8] at com.sun.proxy.$Proxy3394.unregisterAdvice_10(Unknown Source) [na:na] at com.acp.vision.pcrd.ws.impl.UnregisterAdviceWebService.unregisterAdvice_10(UnregisterAdviceWebService.java:128) [ws-core-impl-1.0.2.GA.jar:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88) ~[na:1.7.0] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55) ~[na:1.7.0] at java.lang.reflect.Method.invoke(Method.java:613) ~[na:2.6 (04-21-2013)] at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180) [cxf-core-3.1.8.jar:3.1.8] at org.apache.cxf.jaxws.JAXWSMethodInvoker.performInvocation(JAXWSMethodInvoker.java:66) [cxf-rt-frontend-jaxws-3.1.8.jar:3.1.8] at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96) [cxf-core-3.1.8.jar:3.1.8] at org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.invoke(AbstractJAXWSMethodInvoker.java:232) [cxf-rt-frontend-jaxws-3.1.8.jar:3.1.8] at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:85) [cxf-rt-frontend-jaxws-3.1.8.jar:3.1.8] at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:74) [cxf-core-3.1.8.jar:3.1.8] at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59) [cxf-core-3.1.8.jar:3.1.8] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:482) [na:1.7.0] at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:345) [na:1.7.0] at java.util.concurrent.FutureTask.run(FutureTask.java:177) [na:1.7.0] at org.apache.cxf.interceptor.ServiceInvokerInterceptor$2.run(ServiceInvokerInterceptor.java:126) [cxf-core-3.1.8.jar:3.1.8] at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37) [cxf-core-3.1.8.jar:3.1.8] at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:131) [cxf-core-3.1.8.jar:3.1.8] at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) [cxf-core-3.1.8.jar:3.1.8] at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) [cxf-core-3.1.8.jar:3.1.8] at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:252) [cxf-rt-transports-http-3.1.8.jar:3.1.8] at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234) [cxf-rt-transports-http-3.1.8.jar:3.1.8] at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208) [cxf-rt-transports-http-3.1.8.jar:3.1.8] at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160) [cxf-rt-transports-http-3.1.8.jar:3.1.8] at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:180) [cxf-rt-transports-http-3.1.8.jar:3.1.8] at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:299) [cxf-rt-transports-http-3.1.8.jar:3.1.8] at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:218) [cxf-rt-transports-http-3.1.8.jar:3.1.8] at javax.servlet.http.HttpServlet.service(HttpServlet.java:595) [javax.j2ee.servlet.jar:na] at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:274) [cxf-rt-transports-http-3.1.8.jar:3.1.8] at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1232) [com.ibm.ws.webcontainer.jar:na] at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:781) [com.ibm.ws.webcontainer.jar:na] at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:480) [com.ibm.ws.webcontainer.jar:na] at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178) [com.ibm.ws.webcontainer.jar:na] at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1114) [com.ibm.ws.webcontainer.jar:na] at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:87) [com.ibm.ws.webcontainer.jar:na] at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:940) [com.ibm.ws.webcontainer.jar:na] at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1817) [com.ibm.ws.webcontainer.jar:na] at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200) [com.ibm.ws.webcontainer.jar:na] at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:463) [com.ibm.ws.runtime.jar:na] at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:530) [com.ibm.ws.runtime.jar:na] at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:316) [com.ibm.ws.runtime.jar:na] at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:287) [com.ibm.ws.runtime.jar:na] at com.ibm.ws.ssl.channel.impl.SSLConnectionLink.determineNextChannel(SSLConnectionLink.java:1049) [com.ibm.ws.runtime.jar:na] at com.ibm.ws.ssl.channel.impl.SSLConnectionLink$MyReadCompletedCallback.complete(SSLConnectionLink.java:643) [com.ibm.ws.runtime.jar:na] at com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1818) [com.ibm.ws.runtime.jar:na] at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175) [com.ibm.ws.runtime.jar:na] at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217) [com.ibm.ws.runtime.jar:na] at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161) [com.ibm.ws.runtime.jar:na] at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138) [com.ibm.ws.runtime.jar:na] at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204) [com.ibm.ws.runtime.jar:na] at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775) [com.ibm.ws.runtime.jar:na] at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905) [com.ibm.ws.runtime.jar:na] at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1881) [com.ibm.ws.runtime.jar:na] Caused by: com.ctc.wstx.exc.WstxIOException: Unexpected end of file from server
I am appreciate for any help.