I'm developing a Spring Boot application that is acting as a channel between 2 components. which consume SOAP Request and Produces SOAP Response.
eg:-
A -> calling party
B -> My Component
C -> client party.
A<->B<->C
Previously A and C are connecting to each other directly through SOAP operations. C party is using RPC encoded WSDL.
I have deployed the party C WSDL interface using the below code. As I need to forward the Request to C and Process Request from A.
Creating Endpoint using @Endpoint
annotation as below and @XPathParam
to read tag value.
I want to return that SOAP response to Party A. which is coming from Party C. But Cannot figure out how to return the SOAP response coming from C to A.
A hint would be helpful.
@Bean
public Wsdl11Definition wsdl11Definition(){
SimpleWsdl11Definition simpleWsdl11Definition = new SimpleWsdl11Definition();
simpleWsdl11Definition.setWsdl(new ClassPathResource("/wsdl/calculator.wsdl"));
return simpleWsdl11Definition;
}
@Bean
public ServletRegistrationBean<MessageDispatcherServlet>
messageDispatcherServlet(ApplicationContext applicationContext){
MessageDispatcherServlet messageDispatcherServlet = new MessageDispatcherServlet();
messageDispatcherServlet.setApplicationContext(applicationContext);
return new ServletRegistrationBean<>(messageDispatcherServlet, "/medium/ws/*");
}
@ResponsePayload
@PayloadRoot(namespace = "http://medium.com/types/calculator", localPart = "AdditionInput")
public Output addition(@XPathParam("lineId") String lineID){
// Calling Party C and creating Request Using Apache Axis tool for party C
// String response = SOAP Response from Party C.
}
I have deployed Client WSDL as we are consuming request and forwarding this request to C. So, I have created my one Object and Mapped value of C Response in Object. I have return that Object in Response. Using Interceptor, I have converted that Object to desired Response.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.