just a small precision. I made previously a mistake for client configuration
with spring.
At the client side, I have the following cxf-beans.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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">
<jaxws:client id="client"
serviceClass="test.ServiceInterface"
address="
http://localhost:8080/SOAP-test2/services/ServicePort" >
<jaxws:dataBinding>
<bean class="org.apache.cxf.jaxb.JAXBDataBinding" >
<constructor-arg index="0" ref="globalContext"/>
</bean>
</jaxws:dataBinding>
</jaxws:client>
<bean id= "globalContext" class="test.GlobalContext"
factory-method="getJAXBContext"/>
</beans>
And my java code is:
ClassPathXmlApplicationContext context
= new ClassPathXmlApplicationContext(new String[]
{"test/cxf-beans.xml"});
ServiceInterface client =
(ServiceInterface)context.getBean("client");
System.out.println("calling op with an instance of Class A");
test.A a = new test.A();
a.setX("hello");
client.op(a);
System.out.println("calling op with an instance of Class B");
test.B b = new test.B();
b.setX("salut");
b.setY(2014);
client.op(b);
with this I got the following error:
Mar 4, 2014 5:14:44 PM
org.apache.cxf.service.factory.ReflectionServiceFactoryBean
buildServiceFromClass
INFO: Creating Service {http://test/}ServiceInterfaceService from class
test.ServiceInterface
calling op with an instance of Class A
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Could not
find conduit initiator for address:
http://localhost:8080/SOAP-test2/services/ServicePort and transport:
http://schemas.xmlsoap.org/soap/http
at
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:157)
at com.sun.proxy.$Proxy30.op(Unknown Source)
at
test.ServiceInterface_ServicePort_Client.main(ServiceInterface_ServicePort_Client.java:70)
Caused by: java.lang.RuntimeException: Could not find conduit initiator for
address: http://localhost:8080/SOAP-test2/services/ServicePort and
transport: http://schemas.xmlsoap.org/soap/http
at
org.apache.cxf.binding.soap.SoapTransportFactory.getConduit(SoapTransportFactory.java:236)
at
org.apache.cxf.binding.soap.SoapTransportFactory.getConduit(SoapTransportFactory.java:245)
at
org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:103)
at
org.apache.cxf.endpoint.UpfrontConduitSelector.prepare(UpfrontConduitSelector.java:63)
at
org.apache.cxf.endpoint.ClientImpl.prepareConduitSelector(ClientImpl.java:886)
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:560)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:474)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:377)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:330)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
at
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135)
... 2 more
seems maybe that my beans file is not well configured for my service
location maybe?
But I can't see where is the problem
regards,
Diana
--
View this message in context:
http://cxf.547215.n5.nabble.com/How-to-configure-CXF-for-a-single-JAXBContext-and-for-an-automatic-JAXBElement-conversion-tp5740782p5740799.html
Sent from the cxf-user mailing list archive at Nabble.com.