JAX-WS Spring Client Detailed

Source: Internet
Author: User
Tags soap soap client wsdl
JAX-WS Spring Client Detailed 2010-07-06 17:42

1 The Wevservice client is injected into the spring configuration file through <jaxws:client> elements, similar to the <jaxws:endpoint> elements being serviced by the user

2 Concrete Examples

<?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=" Helloclient "
                   serviceclass= "Demo.spring.HelloWorld"
                   address= "Http://localhost:9002/HelloWorld" &NBSP;/>
</ Beans>

<jaxws:client> Element Description:

Id:string type, unique identity, can be invoked by the bean of spring

Serviceclass:class type, full class name, SEI interface name

Address:qname type, corresponding to Wsdl:service@name.

Endpointname:qname, corresponding Wsdl:port@name

Wsdllocation:url type, A URL to connect to to retrieve the WSDL for the service. This isn't required

3 more detailed examples

<?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 bea n= "Anotherinterceptor"/> </jaxws:inInterceptor> <jaxws:handlers> <ref bean= "Jaxwshandler" /> </jaxws:handlers> &Lt;jaxws:properties> <entry key= "mtom-enabled" value= "true"/> </jaxws:properties> </jaxws:cli Ent> </beans>
<jaxws:client> child elements:
Jaxws:ininterceptors: Interceptor, you must implement each should implement Org.apache.cxf.interceptor.Interceptor or Org.apache.cxf.phase.PhaseInterceptor

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.