I configured in web.xml of my web-app to redirect http request to https. It
works well with the browser. But it does not work with my client.
If my client connects the service with https://... , it works fine, but
fails if http:// is in use.
Best regards,
Ming
===============================================
I defined the service endpoint like this
===============================================
<jaxws:endpoint id="sessionService"
implementor="de.destatis.idb.web.ws.service.cxf.SessionWebServiceImpl"
address="/SessionService"
serviceName="SessionService"/>
===============================================
I set the autoredirect programatically like this
===============================================
Client client = this.clientProxyFactory.getClientFactoryBean().getClient();
HTTPConduit conduit = (HTTPConduit) client.getConduit();
HTTPClientPolicy clientPolicy = new HTTPClientPolicy();
clientPolicy.setReceiveTimeout(2 * 60 * 1000);
clientPolicy.setAutoRedirect(true);
conduit.setClient(clientPolicy);
===============================================
This is the log:
===============================================
13.01.2009 16:04:26 org.apache.cxf.transport.http.HTTPConduit prepare
INFO: AutoRedirect is turned on.
13.01.2009 16:04:26 org.apache.cxf.phase.PhaseInterceptorChain doIntercept
INFO: Interceptor has thrown exception, unwinding now
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:220)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:466)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:299)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:251)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
at
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
at $Proxy49.login(Unknown Source)
at
de.destatis.idb.web.ws.client.cxf.CXFWebServiceClientProxy$SessionWebServiceClientImpl.login(CXFWebServiceClientProxy.java:179)
at
de.destatis.idb.test.TestIDBSessionServiceClient.main(TestIDBSessionServiceClient.java:35)
Caused by: java.io.IOException: Illegal Protocol https for HTTP
URLConnection Factory.
at
org.apache.cxf.transport.http.HttpURLConnectionFactoryImpl.createConnection(HttpURLConnectionFactoryImpl.java:44)
at
org.apache.cxf.transport.http.HTTPConduit.retransmit(HTTPConduit.java:1582)
at
org.apache.cxf.transport.http.HTTPConduit.redirectRetransmit(HTTPConduit.java:1446)
at
org.apache.cxf.transport.http.HTTPConduit.processRetransmit(HTTPConduit.java:1367)
at
org.apache.cxf.transport.http.HTTPConduit.access$300(HTTPConduit.java:135)
at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleRetransmits(HTTPConduit.java:1910)
at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1937)
at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1867)
at
org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:595)
at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
... 9 more
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Could not
send Message.
at
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:145)
at $Proxy49.login(Unknown Source)
at
de.destatis.idb.web.ws.client.cxf.CXFWebServiceClientProxy$SessionWebServiceClientImpl.login(CXFWebServiceClientProxy.java:179)
at
de.destatis.idb.test.TestIDBSessionServiceClient.main(TestIDBSessionServiceClient.java:35)
Caused by: 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:220)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:466)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:299)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:251)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
at
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
... 3 more
Caused by: java.io.IOException: Illegal Protocol https for HTTP
URLConnection Factory.
at
org.apache.cxf.transport.http.HttpURLConnectionFactoryImpl.createConnection(HttpURLConnectionFactoryImpl.java:44)
at
org.apache.cxf.transport.http.HTTPConduit.retransmit(HTTPConduit.java:1582)
at
org.apache.cxf.transport.http.HTTPConduit.redirectRetransmit(HTTPConduit.java:1446)
at
org.apache.cxf.transport.http.HTTPConduit.processRetransmit(HTTPConduit.java:1367)
at
org.apache.cxf.transport.http.HTTPConduit.access$300(HTTPConduit.java:135)
at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleRetransmits(HTTPConduit.java:1910)
at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1937)
at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1867)
at
org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:595)
at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
... 9 more
--
View this message in context:
http://www.nabble.com/problem-with-redirect-http-request-to-https-tp21438244p21438244.html
Sent from the cxf-user mailing list archive at Nabble.com.