CXF has a <jaxws:client />
element that is used for configuring the client.
You specify an @WebService
annotated Interface as the serviceClass
property, and the endpoint URL as the address
property. For example, assuming wsdl2java generated com.w3schools.webservices.TempConvertSoap
<?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="tempconvertClient"
serviceClass="com.w3schools.webservices.TempConvertSoap"
address="http://www.w3schools.com/webservices/tempconvert.asmx" />
</beans>
You can inject the tempconvertClient
bean as com.w3schools.webservices.TempConvertSoap
, and use it to make your service calls.
For more information, see the CXF JAX-WS Configuration documentation.