spring-ws

Adding detail in a WS SoapFault : my custom ExceptionResolver is not used

我是研究僧i 提交于 2019-12-17 20:27:32
问题 I'm building a web service using Spring Boot (1.2.4.RELEASE) and I'm quite new to this framework. Especially, I'm trying to customize the SoapFault content when an exception is thrown (adding a "detail" tag). I followed this article to do so : http://www.stevideter.com/2009/02/18/of-exceptionresolvers-and-xmlbeans/ Here is my exception: package foo.bar.exception; import org.springframework.ws.soap.server.endpoint.annotation.FaultCode; import org.springframework.ws.soap.server.endpoint

Hibernate validator constraints in XML

故事扮演 提交于 2019-12-14 04:22:27
问题 I am using xml file to specify my constraints on an incoming request bean. I do this in a validation-constraints.xml file as follows: <?xml version="1.0" encoding="UTF-8"?> <constraint-mappings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jboss.org/xml/ns/javax/validation/mapping validation-mapping-1.0.xsd" xmlns="http://jboss.org/xml/ns/javax/validation/mapping"> <default-package>com.mathworks.internal.business.geoTypes </default-package> <bean class=

SOAP webservice endpoint from WSDL

自闭症网瘾萝莉.ら 提交于 2019-12-14 04:21:31
问题 I am new to the SOAP web service and so referenced one of the tutorial to create a SOAP webservice using Spring. . I have created the wsdl from the xsd that looks like this. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://spring.io/guides/gs-producing-web-service" targetNamespace="http://spring.io/guides/gs-producing-web-service" elementFormDefault="qualified"> <xs:element name="getCountryRequest"> <xs:complexType> <xs:sequence> <xs:element name="name" type="xs:string

how to set proxy server details on WebServiceTemplate

隐身守侯 提交于 2019-12-13 14:40:56
问题 I have a SOAP webservice endpoint url(let's say :"EP1") which we can connect only through a proxy server. We are using org.springframework.ws.client.core.WebServiceTemplate class to consume webservices. My question is, Is there a way that I can pass/set the proxy server details on WebServiceTemplate to connect to endpoint url "EP1"? 回答1: You must use VM arguments: -Dhttp.proxyHost=mydomain.com -Dhttp.proxyPort=8080 Having in mind that this setting applies to all HTTP requests made from Java.

Spring WS How to get all error messages when validation fails

走远了吗. 提交于 2019-12-13 07:14:37
问题 When xsd validation fails I am trying to get all the error messages (SOAP detail element) and save them. Code below works but only brings the first error, how can I get all of them ? public class PayloadValidationgInterceptorCustom extends PayloadValidatingInterceptor { @Override protected Source getValidationRequestSource(WebServiceMessage webSerMessage) { source = webSerMessage.getPayloadSource(); validateSchema(source); return source; } private void validateSchema(Source source) throws

spring-ws and contract-first approach

≡放荡痞女 提交于 2019-12-13 04:35:52
问题 In spring-ws reference documentation, they say that it uses a contract-first approach (i.e. WSDL comes first), and that spring-ws even doesn't support a contract-last approach. But then, in the first example (page 15), a Java class is created, annotated with @Endpoint, and the WSDL is generated afterwards. So, isn't it contract-last approach? 回答1: It's always a discussion if it's first or last. But you've got to start somewhere. I don't know exactly what you are referring to, but mostly the

How RESTTemplate Supports for Multipart/mixed in consumption

风流意气都作罢 提交于 2019-12-13 02:09:00
问题 The REST service provider returns a media type of multipart/mixed and it has several boundaries such as application/xml and octstream . Which HttpMessageConverter could be used to satisfy this scenario. POST: someUrl Content-Type: multipart/mixed --edt7Tfrdusa7r3lNQc79vXuhIIMlatb7PQg7Vp Content-Disposition: form-data; name="meta-data" Content-Type: application/json; charset=UTF-8 Content-Transfer-Encoding: 8bit { "name": "value" } --edt7Tfrdusa7r3lNQc79vXuhIIMlatb7PQg7Vp Content-Disposition:

How to use PayloadLoggingInterceptor and SOAPLoggingInterceptor interceptors while consuming a third party web service

荒凉一梦 提交于 2019-12-12 09:20:17
问题 In my application, I am consuming a third party web-service that is provided by my client. I have developed my application on Spring and Hibernate framework and in one module I am consuming this third party web-service url. I have generated web-service stubs using javab2-maven-plugin The maven plugin in declared as below in my pom.xml file : <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>jaxb2-maven-plugin</artifactId> <version>1.5</version> <executions> <execution> <id>xjc</id>

Removing namespace prefix in the output of Spring WS web service

徘徊边缘 提交于 2019-12-12 09:11:08
问题 I have created web service using Spring-WS. When I send a request to the web service, this is the response I get in soap-ui: enter code here <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <ns2:SendResponse xmlns:ns2="http://mycompany.com/schema/"> <ns2:SendResult> <ns2:Token>A00179-02</ns2:Token> </ns2:SendResult> </ns2:SendResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope> Is there any way to get rid of the "ns2" namespace

Spring WS Client — Authentication with Server and Client Certificates

*爱你&永不变心* 提交于 2019-12-12 04:02:24
问题 I need to be able to do a "client cert" authentication for a SOAP service. I'm using Spring WS. I have: a my.key , a myCA.pem , and a myClient.crt . This is my relevant Java piece of code (I know it's still messy but I'm just trying to get it to work first): public TheResponse doIt(TheRequest request) { log.info("Sending request..."); try { InputStream is = new FileInputStream(new File("src/main/resources/keystore.jks")); KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());