spring-ws

Spring WS: How to get and save XSD validation errors

情到浓时终转凉″ 提交于 2019-12-01 03:03:30
I use SpringWS for my soap service and validate it like this; <sws:interceptors> <bean id="payloadValidatingInterceptor" class="org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor"> <property name="schema" value="/schemas/my.xsd"/> <property name="validateRequest" value="false"/> <property name="validateResponse" value="true"/> </bean> @PayloadRoot(namespace = NAMESPACE, localPart = "ServiceProvider") @ResponsePayload public ServiceProviderTxn getAccountDetails(@RequestPayload ServiceProviderrequest) { ...} This works fine but when there is an error it returns

How to access HTTP headers in Spring-ws endpoint?

荒凉一梦 提交于 2019-11-30 23:56:03
问题 How can I access HTTP headers in Spring-ws endpoint? My code looks like this: public class MyEndpoint extends AbstractMarshallingPayloadEndpoint { protected Object invokeInternal(Object arg) throws Exception { MyReq request = (MyReq) arg; // need to access some HTTP headers here return createMyResp(); } } invokeInternal() gets only the unmarshalled JAXB object as the parameter. How can I access HTTP headers that came with the request inside invokeInternal() ? One way that would probably work

How do I specify which kind of version of soap do I use with webServiceTemplate?

自古美人都是妖i 提交于 2019-11-30 23:43:58
问题 I am developing a soap web service client with spring. I am using webServiceTemplate How do I specify which kind of version of soap do I use? I can see that it s using soap 1.1 by default. I want to force it to use soap 1.2 How can I do that? 回答1: <bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory"> <property name="soapVersion"> <util:constant static-field="org.springframework.ws.soap.SoapVersion.SOAP_12"/> </property> </bean> i just found, i need to pass

Spring 3 (SWS2): difference between <context:component-scan> and <sws:annotation-driven>

跟風遠走 提交于 2019-11-30 20:44:33
When trying a simple Web Service Hello World example with just one @Endpoint annotated class, the Endpoint is not registered when using the <sws:annotation-driven/> namespace. However, by adding the usual <context:component-scan> , everything works well, the Endpoint-class is registered correctly. This is only true for the @Endpoint annotation, all other annotations ( @RequestPayload , @ResponsePayload , @PayloadRoot ) will be registered by the sws-namespace as expected. Should the @Endpoint annotation not be processed by this namespace as well? <beans> <!-- works for all annotations except

How to use WSDL with spring-boot?

烂漫一生 提交于 2019-11-30 12:44:20
问题 I have WSDL and schema files provided by client. I need to create Spring-boot SOAP web service with this WSDL file. I have google it and all the examples that I can find, they have auto-generate the wsdl with spring.How can I use my WSDL to generate the SOAP service? 回答1: Here are the common steps to follow to use your existing wsdl with Spring-Ws and Spring-boot. Config class @EnableWs @Configuration public class WebServiceConfig extends WsConfigurerAdapter { @Bean public

Spring Web Service Client Tutorial or Example Required

我们两清 提交于 2019-11-30 11:41:31
问题 I need to jump into the Spring Web Service Project, in that I required to implement the Spring Web Service's Client Only.. So, I have already gone through with Spring's Client Reference Document. So, I got the idea of required classes for the implementation of Client. But my problem is like I have done some googling, but didn't get any proper example of both Client and Server from that I can implement one sample for my client. So, if anybody gives me some link or tutorial for proper example

Spring 3 (SWS2): difference between <context:component-scan> and <sws:annotation-driven>

♀尐吖头ヾ 提交于 2019-11-30 05:27:23
问题 When trying a simple Web Service Hello World example with just one @Endpoint annotated class, the Endpoint is not registered when using the <sws:annotation-driven/> namespace. However, by adding the usual <context:component-scan> , everything works well, the Endpoint-class is registered correctly. This is only true for the @Endpoint annotation, all other annotations ( @RequestPayload , @ResponsePayload , @PayloadRoot ) will be registered by the sws-namespace as expected. Should the @Endpoint

WebServiceTemplate with Basic Auth using HttpComponentsMessageSender

一曲冷凌霜 提交于 2019-11-30 05:12:46
问题 I am trying to test a Spring Web Service which is currently secured with Basic Authentication underneath. For these tests, I have written a Web Service client using Spring's WebServiceTemplate class. My Web Service client calls to the Web Service work okay when I create the template's MessageSender as a org.springframework.ws.transport.http.CommonsHttpMessageSender object bean with org.apache.commons.httpclient.UsernamePasswordCredentials and, although the client works, the code has a warning

Is there a built-in Spring environment variable for the web context root?

可紊 提交于 2019-11-30 05:03:06
I'm using Spring Web Services to expose a service as a web service. In my spring configuration xml file, I have a bean which is an instance of DefaultWsdl11Definition. One of the properties that needs to be set is the locationUri . This needs to be a fully qualified Uri, but I don't want to have to change this value when the application gets promoted from dev to uat and to production. Spring knows what the web application context root is, so is there a variable that I can specify in my configuration file to access it? Something like: <bean id="myWebServices" class="org.springframework.ws.wsdl

How to use WSDL with spring-boot?

送分小仙女□ 提交于 2019-11-30 03:59:44
I have WSDL and schema files provided by client. I need to create Spring-boot SOAP web service with this WSDL file. I have google it and all the examples that I can find, they have auto-generate the wsdl with spring.How can I use my WSDL to generate the SOAP service? Here are the common steps to follow to use your existing wsdl with Spring-Ws and Spring-boot. Config class @EnableWs @Configuration public class WebServiceConfig extends WsConfigurerAdapter { @Bean public ServletRegistrationBean messageDispatcherServlet(ApplicationContext applicationContext) { MessageDispatcherServlet servlet =