Here is a example for you :)
<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-extension-http-binding.xml"/>
<import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>
<bean id="JaxWsServiceFactoryBean"
class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean">
<property name="wrapped" value="false"/>
</bean>
<bean id="greeterServerFactory"
class="org.apache.cxf.jaxws.JaxWsServerFactoryBean"
init-method="create">
<property name="serviceClass"
value="org.apache.cxf.customer.bare.CustomerService" />
<property name="serviceBean">
<bean class="org.apache.cxf.customer.bare.CustomerService"/>
</property>
<property name="address" value="/services/serverFactory/restful"/>
<property name="bus" ref="cxf"/>
<!-- *setting the binding here* -->
<property name="bindingId" value="http://apache.org/cxf/binding/http"/>
<property name="transportId"
value="http://schemas.xmlsoap.org/wsdl/soap/http"/>
<property name="serviceFactory" ref="JaxWsServiceFactoryBean"/>
</bean>
<jaxws:endpoint id="restfulServer"
implementor="org.apache.cxf.customer.bare.CustomerService"
address="/services/endpoint/restful"
bindingUri="http://apache.org/cxf/binding/http">
<jaxws:serviceFactory>
<ref bean="JaxWsServiceFactoryBean"/>
</jaxws:serviceFactory>
</jaxws:endpoint>
</beans>
Willem.
Sric wrote:
Hi,
I have a REST service that I am trying to invoke through a Java client
managed by Spring. I need to set the BindingId on the
org.apache.cxf.jaxws.JaxWsProxyFactoryBean bean. Currently my configuation
is as following:
<bean id="factory" class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean">
<property name="serviceClass" value="com.fm.services.search.ISearch"/>
<property name="address"
value="http://server:8080/my_service/services/xml/service/"/>
</bean>
How do I set the BindingId in the above Spring bean definition? I know it
can be set using the java call
factory.getClientFactoryBean().setBindingId(HttpBindingFactory.HTTP_BINDING_ID);
Thanks
Sriram