1 <?xml version="1.0" encoding="UTF-8"?>
2 <beans xmlns="http://www.springframework.org/schema/beans"
3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4 xmlns:context="http://www.springframework.org/schema/context"
5 xmlns:sws="http://www.springframework.org/schema/web-services"
6 xmlns:oxm="http://www.springframework.org/schema/oxm"
7 xmlns:aop="http://www.springframework.org/schema/aop"
8 xmlns:util="http://www.springframework.org/schema/util"
10 xsi:schemaLocation="http://www.springframework.org/schema/beans
11 http://www.springframework.org/schema/beans/spring-beans.xsd
12 http://www.springframework.org/schema/context
13 http://www.springframework.org/schema/context/spring-context.xsd
14 http://www.springframework.org/schema/web-services
15 http://www.springframework.org/schema/web-services/web-services.xsd
16 http://www.springframework.org/schema/oxm
17 http://www.springframework.org/schema/oxm/spring-oxm.xsd
18 http://www.springframework.org/schema/util
19 http://www.springframework.org/schema/util/spring-util.xsd">
22 This file is an example about how someone should write code in order to send and
23 receive data from the Web Services.
26 <!-- Searches for @Endpoint -->
27 <context:component-scan base-package="de.spring.webservices"/>
29 <oxm:jaxb2-marshaller id="marshaller" context-path="de.spring.webservices.auto"/>
31 <!-- Searches for @PayloadRoot -->
32 <sws:annotation-driven marshaller="marshaller" unmarshaller="marshaller"/>
35 <!-- Required in order to use SOAP 1.2
36 id="messageFactory" is not a random choice, if you use another name it will not work
37 (Spring will end up loading SOAP 1.1)
39 <bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory">
40 <property name="soapVersion">
41 <util:constant static-field="org.springframework.ws.soap.SoapVersion.SOAP_12" />
47 <bean class="org.springframework.ws.soap.server.endpoint.interceptor.SoapEnvelopeLoggingInterceptor">
48 <property name="logRequest" value="true"/>
49 <property name="logResponse" value="true"/>
54 ¿Este validador funciona teniendo inheritance en el xsd? (inheritances es una cosa especial
55 del JAXB2 que estoy usando para generar las clases desde el xsd)
56 Parece que el unmarshal (que supongo que se hace con el JAXB2 que está en el classpath
57 debido al tipo de Endpoint que estoy usando, que por cierto no sé cual JAXB2 está cogiendo realmente)
58 funciona, así que supongo el validador tambien :/
59 Lo que realmente tampoco sé es si hay alguna relación entre los validadores y JAXB2 :/
61 <bean id="payloadValidatingInterceptor"
62 class="org.springframework.ws.client.support.interceptor.PayloadValidatingInterceptor">
63 <property name="schemas">
65 <value>classpath:examples.xsd</value>
66 <value>classpath:parent.xsd</value>
69 <property name="validateRequest" value="true"/>
70 <property name="validateResponse" value="true"/>
74 <bean id="webServiceTemplate" class="org.springframework.ws.client.core.WebServiceTemplate">
75 <constructor-arg ref="messageFactory"/>
76 <property name="marshaller" ref="marshaller" />
77 <property name="unmarshaller" ref="marshaller" />
79 <!-- For local deployments change to http://localhost:8080/web-services-spring-server/spring-ws/example -->
80 <property name="defaultUri" value="http://gumartinm.name/spring-ws/example"/>
82 <property name="interceptors">
84 <ref bean="payloadValidatingInterceptor" />
89 <bean id="exampleClient" class="de.spring.webservices.client.ExampleClientService">
91 @Autowired works even using XML configuration as long as you use context:component-scan
92 <property name="webServiceTemplate" ref="webServiceTemplate"/>