spring-ws

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

谁都会走 提交于 2019-12-04 20:23:23
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> <goals> <goal>xjc</goal> </goals> </execution> </executions> <configuration> <!-- Package to store the

Received fatal alert: unknown_ca while mutual authentication

末鹿安然 提交于 2019-12-04 19:03:23
I'm working on a web service client which need to communicate with a server who has mutual authentication enabled. I've done the following steps. Added the server certificate(self signed) to a trust store and set it to the HttpsURLConnection using the SSLSocketFactory . Gave the client certificate(CA signed) to the server admin to add it to their trusted store. Created a keystore by importing the client certificate and created a keymanager to `HttpsURLConnection'. When I try to run this sample I'm getting an exception saying org.springframework.ws.soap.axiom.AxiomSoapMessageException: Could

Removing namespace prefix in the output of Spring WS web service

谁说胖子不能爱 提交于 2019-12-04 15:10:40
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 prefix from the response? I tried a couple of options: 1) Manually updated package-info.java to set the

How to create custom soap fault message using spring web service

♀尐吖头ヾ 提交于 2019-12-04 14:01:22
问题 I'm trying to write a web service using spring web service library. I'm able to configure my endpoints successfully and it is working fine, but I'm facing some issues with the exception mappings. I'm able to map exceptions using @SoapFault and SoapFaultAnnotationExceptionResolver but the wsdl definition is as follows <xsd:schema elementFormDefault="qualified" targetNamespace="http://abc.com/soap/"> <xsd:complexType name="ServiceException"> <xsd:sequence> <xsd:element name="message" nillable=

Upgraded from Spring 4.1.6 to 4.2.4 and suddenly getting TransactionRequiredException

寵の児 提交于 2019-12-04 12:48:35
I have upgraded to latest Spring version from 4.1.6.Release to 4.2.4.Release and suddenly all what has functioned smoothly before, now throws the following exception. javax.persistence.TransactionRequiredException: No EntityManager with actual transaction available for current thread - cannot reliably process 'persist' call at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:277) ~[na:4.2.4.RELEASE] at com.sun.proxy.$Proxy51.persist(Unknown Source) ~[na:na] Interceptor.class public class MessageInterceptor

SoapFaultMappingExceptionResolver never gets hit with regular java exception

半世苍凉 提交于 2019-12-04 10:59:49
Can anyone tell me why I cant catch a regular Java exception with my resolver so I can transform it before the response is sent back? It never gets hit with a breakpoint. If its not possible, how can I? SoapFaultMappingExceptionResolver public class LisSoapFaultTranslatorExceptionResolver extends SoapFaultMappingExceptionResolver { @Override protected void customizeFault(Object endpoint, Exception ex, SoapFault fault) { SoapFaultDetail detail = fault.addFaultDetail(); } } Bean <sws:annotation-driven /> <bean class="org.springframework.ws.server.endpoint.mapping

Spring boot 2.1.1 to 2.1.2: Error creating bean with name 'payloadRootAnnotationMethodEndpointMapping'

懵懂的女人 提交于 2019-12-04 10:58:39
Migrating from spring boot 2.1.1 to 2.1.2 caused the following error: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'payloadRootAnnotationMethodEndpointMapping' defined in class path resource [org/springframework/ws/config/annotation/DelegatingWsConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping]: Factory method

No adapter for endpoint; Is your endpoint annotated with @Endpoint, or does it implement a supported interface like MessageHandler or PayloadEndpoint?

匆匆过客 提交于 2019-12-04 09:21:52
问题 I am struggling with an Spring-WS with JMS example. I set the Spring-WS and JMS wiring as per the Spring recommendations. But I kept getting following error. I dont know how to bypass this issue, any help will be highly appreciated: [org.springframework.ws.soap.server.endpoint.SoapFaultAnnotationExceptionResolver] - Resolving exception from endpoint [org.springframework.ws.samples.mtom.ws.ImageRepositoryEndpoint@1c8b0b1]: java.lang.IllegalStateException: No adapter for endpoint [org

spring-boot-starter-ws performance when run as jar

蓝咒 提交于 2019-12-04 07:52:08
We've noticed in our that SOAP web-services seem to run faster when run as spring-boot:run as opposed to packaging up the JAR as we do for deployment and running java -jar mySpringApp.jar The speed up is in the order of 2-3x so obviously we would like this for our live environment. To validate that this wasn't something in our app I've tried this with the sample app from the spring guide git source https://github.com/spring-guides/gs-soap-service.git Testing this with JMeter shows the same sort of speed up. I've tested this on both Windows 7 Java 1.8.0_31 and Ubuntu 14.04 platforms with 1.8.0

Stream MTOM Web Services in Spring Web Services Framework

孤者浪人 提交于 2019-12-04 07:24:50
I would like to send large files from the server to the client using MTOM and Spring WS. I realize that this isn't the best approach for this type of thing, but it's a requirement. I have MTOM set up and it works great for small files around 50mb. I am experiencing out of memory errors for larger files and by changing different heap space sizes, I can send slightly larger files, but nothing close to 1gb. 1GB is my test case for this. How can I stream or chunk the MTOM service from the server to the client? I am using Java 6 update 17, Tomcat 6, and Spring WS 1.5.7 with the