I am trying to use the fuelsdk in an osgi environment in AEM. I am getting this error -
java.lang.ClassCastException: com.sun.xml.internal.ws.client.sei.SEIStub cannot be cast to org.apache.cxf.frontend.ClientProxy
This is because OSGi loads the system bundle before the bundle in which fuelsdk's dependency has been embedded. The bundle gets resolved; this error is during run time.
How can I force the OSGi classloader to pick org.apache.cxf.frontend.ClientProxy instead of com.sun.xml.internal.ws.client.sei.SEIStub at run time ?
Can I use the combination of 'uses' directive ; and/or import/export packages ?
I have been suggested to create the client using -
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.getInInterceptors().add(new LoggingInInterceptor());
factory.getOutInterceptors().add(new LoggingOutInterceptor());
factory.setServiceClass(HelloWorld.class);
factory.setAddress("http://localhost:9000/helloWorld");
soapClient = (Client) factory.create();
I would like to know which class should I use in factory.setServiceClass();
and
which address should I use in factory.setAddress( ) ; is it the endpoint address ? -- https://webservice.s6.exacttarget.com/Service.asmx
Help is highly appreciated Thanks