2010-04-13 2 views
1

엔드 포인트 (클라이언트 측만)와 통신해야하는 XSD 문서가 있습니다.이 기능이 봄에 구축되어 있습니까? 나는 JAXB를 사용하고 있었지만 스프링에 일종의 래퍼가 있는지 궁금해하고 있었다. 감사.스프링의 XSD 클라이언트

+0

정확히 무엇을위한 래퍼? 어떤 유형의 프로토콜을 사용하여 데이터를 보내십니까? REST, SOAP 등을위한 것인가? –

+0

간단한 HTTP 게시 – wuntee

답변

1

결국 POX와 SOAP를 사용하도록 WebServiceTemplate에서 MessageFactory를 변경해야합니다. 희망이 사람을 돕는다!

참고 : http://static.springsource.org/spring-ws/sites/1.5/reference/html/client.htmlhttp://static.springsource.org/spring-ws/sites/1.5/reference/html/oxm.html

<?xml version="1.0" encoding="UTF-8"?> 
<beans xmlns="http://www.springframework.org/schema/beans" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xmlns:aop="http://www.springframework.org/schema/aop" 
     xmlns:util="http://www.springframework.org/schema/util" 
     xmlns:oxm="http://www.springframework.org/schema/oxm" 
     xsi:schemaLocation=" 
      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd 
      http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd 
      http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd 
      http://www.springframework.org/schema/oxm http://www.springframework.org/schema/oxm/spring-oxm-1.5.xsd" 
     default-autowire="no" default-init-method="init" default-destroy-method="destroy"> 

    <bean id="jaxb2Marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller"> 
     <property name="contextPath" value="com.cable.comcast.neto.nse.sams.pox"/> 
    </bean>  

    <bean id="messageFactory" class="org.springframework.ws.pox.dom.DomPoxMessageFactory"/> 

    <bean id="webServiceTemplate" class="org.springframework.ws.client.core.WebServiceTemplate"> 
     <constructor-arg ref="messageFactory"/>  
     <property name="messageSender"> 
      <bean class="org.springframework.ws.transport.http.CommonsHttpMessageSender" /> 
     </property> 
     <property name="defaultUri" value="http://sams-web.cable.comcast.com/ttsgateway/Inbound"/> 
     <property name="marshaller" ref="jaxb2Marshaller" /> 
     <property name="unmarshaller" ref="jaxb2Marshaller" /> 
    </bean> 
</beans>