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(namesp...

问题:

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.


回答1:

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");
  • 发表于 2019-02-17 20:15
  • 阅读 ( 359 )
  • 分类:sof

条评论

请先 登录 后评论
不写代码的码农
小编

篇文章

作家榜 »

  1. 小编 文章
返回顶部
部分文章转自于网络,若有侵权请联系我们删除