Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SpringBoot SOAP webservice Dynamic WSDL generation not working If remove Request suffix from RequestPayload element

I am creating SOAP web service using Spring Boot SOAP Webservice Sample project. If I use following code dynamically generated WSDL shows Operations.

@PayloadRoot(namespace = NAMESPACE_URI, localPart = "AvailNotifRequest")
@ResponsePayload
public OTAHotelAvailNotifRS getAvailNotif(@RequestPayload AvailNotifRequest request) {

But I need request element to change like this.

@PayloadRoot(namespace = NAMESPACE_URI, localPart = "OTAHotelAvailNotifRQ")
@ResponsePayload
public OTAHotelAvailNotifRS getOTAHotelAvailNotifRQ(@RequestPayload OTAHotelAvailNotifRQ request) {

I found a similar question on this link Spring web service dynamic wsdl not generating message for a schema element answer says we need to add suffix Request after request element like AvailNotifRequest but I want to use OTAHotelAvailNotifRQ as my request input. How can I use this because I am not getting operations in wsdl when I change request input like this.

like image 756
Rakesh Avatar asked Nov 08 '22 10:11

Rakesh


1 Answers

According to official Spring-WS documentation:

The <dynamic-wsdl> builds a WSDL from a XSD schema by using conventions. It iterates over all element elements found in the schema, and creates a message for all elements. Next, it creates WSDL operation for all messages that end with the defined request or response suffix. The default request suffix is Request; the default response suffix is Response, though these can be changed by setting the requestSuffix and responseSuffix attributes on <dynamic-wsdl />, respectively.

In other words you can use the setRequestSuffix and setResponseSuffix on DefaultWsdl11Definition in order to specify a request and response suffix different from the default one. In the above case that could for example be:

wsdl11Definition.setRequestSuffix("RQ");
wsdl11Definition.setResponseSuffix("RS");
like image 81
CodeNotFound Avatar answered Jan 04 '23 03:01

CodeNotFound