spring-ws

Creating a Spring Web Service using Plain Old XML (POX)

一个人想着一个人 提交于 2021-02-08 08:46:18
问题 So, I'm writing a Spring Web Service for an already-existing application to talk to. I have the service working to where it will receive a request and respond to it but the thing is, the application expects the response to be in Plain Old XML (POX). My response currently has SOAP headers attached to it like so: <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <Person> <FirstName>John</FirstName> <LastName>Smith</LastName> <

How to use connection pooling with HttpsUrlConnectionMessageSender

拟墨画扇 提交于 2021-02-07 10:35:45
问题 I am trying to make a Soap request using Spring WS. The request needs to send across client certificate to the server. I have figured out the configuration that makes the correct request to the server. Code presented below @Bean public HttpsUrlConnectionMessageSender messageSender() throws Exception { HttpsUrlConnectionMessageSender httpsUrlConnectionMessageSender = new HttpsUrlConnectionMessageSender(); httpsUrlConnectionMessageSender.setTrustManagers(<TrustManager>);

How to use connection pooling with HttpsUrlConnectionMessageSender

前提是你 提交于 2021-02-07 10:35:21
问题 I am trying to make a Soap request using Spring WS. The request needs to send across client certificate to the server. I have figured out the configuration that makes the correct request to the server. Code presented below @Bean public HttpsUrlConnectionMessageSender messageSender() throws Exception { HttpsUrlConnectionMessageSender httpsUrlConnectionMessageSender = new HttpsUrlConnectionMessageSender(); httpsUrlConnectionMessageSender.setTrustManagers(<TrustManager>);

Customizing Java packages JAXB wsimport

安稳与你 提交于 2021-02-07 03:19:29
问题 I'm trying to generate a client with maven and jaxb from a wsdl file with 2 schemas inside and some elements with the same name from different schemas When I try to execute the compilation I'm getting the next error: Two declarations cause a collision in the ObjectFactory class. WSDL schemas : <wsdl:types> <schema targetNamespace="http://ws.services" xmlns="http://www.w3.org/2001/XMLSchema">...</schema> <schema targetNamespace="http://ws.models" xmlns="http://www.w3.org/2001/XMLSchema">...<

Customizing Java packages JAXB wsimport

放肆的年华 提交于 2021-02-07 03:08:49
问题 I'm trying to generate a client with maven and jaxb from a wsdl file with 2 schemas inside and some elements with the same name from different schemas When I try to execute the compilation I'm getting the next error: Two declarations cause a collision in the ObjectFactory class. WSDL schemas : <wsdl:types> <schema targetNamespace="http://ws.services" xmlns="http://www.w3.org/2001/XMLSchema">...</schema> <schema targetNamespace="http://ws.models" xmlns="http://www.w3.org/2001/XMLSchema">...<

Using WebServiceTemplate with a keystore

戏子无情 提交于 2021-02-05 20:35:39
问题 Is it possible to configure a WebServiceTemplate with a java keystore? edit I'm looking for a way to configure the location of the keystore in the spring config 回答1: I think you can programatically load a keystore based using a KeyStore.Builder: http://java.sun.com/j2se/1.5.0/docs/api/java/security/KeyStore.Builder.html#newInstance%28java.lang.String,%20java.security.Provider,%20java.io.File,%20java.security.KeyStore.ProtectionParameter%29 So maybe have a class that has a webservice template

Using WebServiceTemplate with a keystore

不想你离开。 提交于 2021-02-05 20:33:42
问题 Is it possible to configure a WebServiceTemplate with a java keystore? edit I'm looking for a way to configure the location of the keystore in the spring config 回答1: I think you can programatically load a keystore based using a KeyStore.Builder: http://java.sun.com/j2se/1.5.0/docs/api/java/security/KeyStore.Builder.html#newInstance%28java.lang.String,%20java.security.Provider,%20java.io.File,%20java.security.KeyStore.ProtectionParameter%29 So maybe have a class that has a webservice template

A security error was encountered when verifying the message, Error reading XMLStreamReader

Deadly 提交于 2021-01-29 14:23:56
问题 I am spinning trying to figure it out what is wrong in my case. I need to decrypt request from client. Keystore should be correct as I have tested with spring WS and there is works (but i can not use spring WS due to soapAction which clicent can not provide in header). This is my WSS4JStaxInInterceptor: @Bean public WSS4JStaxInInterceptor wss4JStaxInInterceptor() throws Exception { Properties properties; Crypto crypto = CryptoFactory.getInstance(wss4jInProperties()); WSSSecurityProperties

Spring Boot web service client authentication

这一生的挚爱 提交于 2021-01-27 05:22:46
问题 My goal is to call web service, which is require authentification (when I opne it's wsdl in my browser, browser asks me login+password). As a base, I use the sample from this tutorial. And now I have to add authentification configurations. Accoding to the documentation something like configuring WebServiceTemplate bean may help. But with Spring Boot there are no applicationContext.xml or any other configuration xml's in a project. So, how to configure WebServiceTemplate using Spring Boot, or

How to set the precedence for custom EndpointExceptionResolver in Spring web services

寵の児 提交于 2020-12-15 05:42:15
问题 I am trying to add custom error handling for Spring SOAP web services (version: 3.0.8) as per the steps in the below ticket. How to return custom SOAP Error from Spring Boot Endpoint Service? Added custom payload validator and EndpointExceptionResolver classes. However when the custom exception is thrown in Payload validator, it is being handled by default resolver (DetailSoapFaultResolver) instead of custom one. Though spring is recognising the new resolver it is given low precedence. How