One comment about configuring the http conduit with Java code.
The configure the http conduit with Java code should work, you just need set the right endpoint address.
Please check out the CXF systest [1] 's testHttpsBasicConnection().

[1]https://svn.apache.org/repos/asf/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/HTTPConduitTest.java


Willem.

Abid Hussain wrote:
Hi again,

I finally got it. I had to put the http:conduit in my configuration:

<http:conduit name="{http://ws.kvv.mi.fuberlin.de/}KvvServiceImplService.http-conduit";>
    <http:tlsClientParameters secureSocketProtocol="SSL" />
</http:conduit>

Sorry for that.

But I find that xfire is really hard to handle, cause it uses all this spring stuff which is quite confusing, if you're not familiar to spring (like me). Everytime something isn't working, I wonder if it's some mysterious spring behaviour and don't recognise that the solution (like above) is pretty easy.

I'm trying to set up a services and clients using CXF for a couple of weeks. Before I was using XFire. Till now my experience is that XFire was MUCH easier to configure and to handle.

Best regards,

Abid


Abid Hussain schrieb:
Hi everybody,

I have the following problem:
My web application contains
- a Web Service and
- a client (which calls another Web Service).

The client calls the remote service using https whereas the service deployed in my application should use http.

I have configured the service as following:
<beans xmlns="http://www.springframework.org/schema/beans";
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
    xmlns:jaxws="http://cxf.apache.org/jaxws";
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd";>

    <import resource="classpath:META-INF/cxf/cxf.xml" />
    <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
    <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />

    <jaxws:endpoint id="moduleServiceImpl"
        implementor="modulverwaltung.service.ModuleServiceImpl"
        address="/ModuleService" />
</beans>

I did the clients's https configuration in the program code:
Client client = ClientProxy.getClient(port);
HTTPConduit conduit = (HTTPConduit) client.getConduit();
TLSClientParameters tlsParams = new TLSClientParameters();
conduit.setTlsClientParameters(tlsParams);

When I try to call the remote service from my client, the following happens:
INFO: Interceptor has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Could not send Message.
at org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:48) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:207)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:205)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135)
    at $Proxy33.getLecturers(Unknown Source)
at kvv.service.client.KvvServiceClient.getLecturers(KvvServiceClient.java:74) at modulverwaltung.tools.AdaptLecturersToKvv.main(AdaptLecturersToKvv.java:29) Caused by: java.io.IOException: Illegal Protocol http for HTTPS URLConnection Factory. at org.apache.cxf.transport.https.HttpsURLConnectionFactory.createConnection(HttpsURLConnectionFactory.java:124) at org.apache.cxf.transport.http.HTTPConduit.prepare(HTTPConduit.java:475) at org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:46)
    ... 8 more

Would be thankful for any help...

Best regards,

Abid Hussain


Reply via email to