...
Name | Description |
---|---|
jaxws:inInterceptors | The incoming interceptors for this endpoint. A list of |
jaxws:inFaultInterceptors | The incoming fault interceptors for this endpoint. A list of |
jaxws:outInterceptors | The outgoing interceptors for this endpoint. A list of |
jaxws:outFaultInterceptors | The outgoing fault interceptors for this endpoint. A list of |
jaxws:features | The features that hold the interceptors for this endpoint. A list of |
jaxws:handlers | The JAX-WS handlers for this endpoint. A list of |
jaxws:properties | A properties map which should be supplied to the JAX-WS endpoint. See below. |
jaxws:dataBinding | You can specify the which DataBinding will be use in the endpoint , This can be supplied using the Spring <bean class="MyDataBinding"/> syntax. |
jaxws:binding | You can specify the BindingFactory for this endpoint to use. This can be supplied using the Spring <bean class="MyBindingFactory"/> syntax. |
jaxws:conduitSelector |
|
Here is a more advanced example which shows how to provide interceptors, JAX-WS handlers, and properties:
Code Block | ||||
---|---|---|---|---|
| ||||
<?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"> <!-- Interceptors extend e.g. org.apache.cxf.phase.AbstractPhaseInterceptor --> <bean id="anotherInterceptor" class="..." /> <!-- Handlers implement e.g. javax.xml.ws.handler.soap.SOAPHandler --> <bean id="jaxwsHandler" class="..." /> <!-- The SOAP client bean --> <jaxws:client id="helloClient" serviceClass="demo.spring.HelloWorld" address="http://localhost:9002/HelloWorld"> <jaxws:inInterceptors> <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/> <ref bean="anotherInterceptor"/> </jaxws:inInterceptor> <jaxws:handlers> <ref bean="jaxwsHandler" /> </jaxws:handlers> <jaxws:properties> <entry key="mtom-enabled" value="true"/> </jaxws:properties> </jaxws:client> </beans> |
...
Info |
---|
Building a Client using this configuration is only applicable for those wishing to inject a Client into their Spring ApplicationContext. |
To build a Client using SpringThis approach requires more explicit Spring bean configuration than the previous option, and may require more configuration data depending on which features are used. To configure a client this way, you'll need to declare a proxy factory bean and also a client bean which is created by that proxy factory. Here is an example:
...
Code Block | ||||
---|---|---|---|---|
| ||||
include org.springframework.context.support.ClassPathXmlApplicationContext; public final class HelloWorldClient { private HelloWorldClient() { } public static void main(String args[]) throws Exception { ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( new String[]{"my/path/to/client-beans.xml"}); HelloWorld client = (HelloWorld)context.getBean("client"); String response = client.sayHi("Dan"); System.out.println("Response: " + response); System.exit(0); } } |
The ProxyFactoryBean JaxWsProxyFactoryBean supports many other properties:
Name | Value Description | ||
---|---|---|---|
clientFactoryBean | The ClientFactoryBean used in construction of this proxy. | ||
password | The password which the transport should use. | ||
username | The username which the transport should use. | ||
wsdlURL | The wsdl URL the client should use to configure itself. | ||
wsdlLocation |
| ||
inInterceptors |
| ||
inFaultInterceptors |
| ||
outInterceptors |
| ||
outFaultInterceptors |
| ||
features |
| ||
handlers | A list of | ||
bindingConfig |
| ||
Appears to be the same as wsdlURL? | |||
serviceName | The name of the service to invoke, if this address/WSDL hosts several. It maps to the wsdl:service@name. In the format of "ns:SERVICE_NAME" where ns is a namespace prefix valid at this scope. | ||
endpointName | The name of the endpoint to invoke, if this address/WSDL hosts several. It maps to the wsdl:port@name. In the format of "ns:ENDPOINT_NAME" where ns is a namespace prefix valid at this scope. | ||
inInterceptors | The incoming interceptors for this endpoint. A list of | ||
inFaultInterceptors | The incoming fault interceptors for this endpoint. A list of | ||
outInterceptors | The outgoing interceptors for this endpoint. A list of | ||
outFaultInterceptors | The outgoing fault interceptors for this endpoint. A list of | ||
features | The features that hold the interceptors for this endpoint. A list of | ||
handlers | A list of | ||
bindingConfig |
| ||
bindingId | The URI, or ID, of the message binding for the endpoint to use. For SOAP the binding URI(ID) is specified by the JAX-WS specification. For other message bindings the URI is the namespace of the WSDL extensions used to specify the binding. | bindingId |
|
bus | A reference to a CXF bus bean. Must be provided if, for example, handlers are used. May require additional Spring context imports (e.g. to bring in the default CXF bus bean). | ||
conduitSelector |
| ||
dataBinding |
| ||
endpointName |
| ||
properties |
| ||
serviceFatory |
| ||
You can specify the which DataBinding will be use in the endpoint , This can be supplied using the Spring <bean class="MyDataBinding"/> syntax. | |||
properties | A properties map which should be supplied to the JAX-WS endpoint. | ||
serviceFactory serviceName |
|
Configuring an Endpoint/Client Proxy Using CXF APIs
...