Spring-ws笔记(配置)

Spring WebService是契约优先的。强调从Schema(xml)到Java Class的绑定。所以首先要熟悉XSD和JiBX或JAXB等binding技术,为了方便,还需属性ant脚本。

闲话少说,贴一个成功部署的war代码。

Java: springstudy.ws.

     client.SpringWSClient.java

     core.BeanMethodDescriptor.java

        |--.WebMethod.java

        |---WebService.java

        |---WebMethodPostProcessor.java

        |---WebServiceErrorResponse.java

     endpoint.SpringWebServiceEndpoint.java

     services.CustomerService.java

     util.BindXmlUtil.java

-----------------------------------------------------------------------

/WEB-INF/schema/test-request.xsd

   

   
     
       
       
     

   

   
   
     
       
       
       
     

   

   
   
     
       
       
       
       
     

   

-----------------------------------test-response.xsd

   

   
     
       
     

   

   
     
       
       
       
       
       
       
     

   

   
     
       
       
       
     

   

---------------------------------------------------------------------

WEB-INF/web.xml

 



  test-springws
   
 
    spring-ws
    org.springframework.ws.transport.http.MessageDispatcherServlet
   
      transformWsdlLocations
      true
   

 

 
    spring-ws
    /services/*
 

 
 
    index.htm
    index.jsp
 

--------------------------------------------------------------

WEB-INF/spring-ws-servlet.xml

 


       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:oxm="http://www.springframework.org/schema/oxm"
       xmlns:sws="http://www.springframework.org/schema/web-services"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
       http://www.springframework.org/schema/oxm http://www.springframework.org/schema/oxm/spring-oxm-1.5.xsd
       http://www.springframework.org/schema/web-services http://www.springframework.org/schema/web-services/web-services-1.5.xsd">

   
       
           
                /WEB-INF/schema/test-request.xsd
                /WEB-INF/schema/test-response.xsd
           

       

       
   

   
   
   
       
       
       
       
       
       
   

   
              class="com.tsinghuatec.dawn.waf.springstudy.ws.services.CustomerWebService">
       
   


   
   
       
       
           
                                    class="org.springframework.ws.server.endpoint.interceptor.PayloadLoggingInterceptor" />
           

       

   

   
   
       
   

   
   

   

你可能感兴趣的:(Java技术心得,string,bean,encoding,class,webservice,binding)