【问题标题】:No endpoint mapping found for [SaajSoapMessage {http://schemas.xmlsoap.org/soap/envelope/}UpdateXXXRequest]未找到 [SaajSoapMessage {http://schemas.xmlsoap.org/soap/envelope/}UpdateXXXRequest] 的端点映射
【发布时间】:2021-04-02 07:30:05
【问题描述】:

我升级了一个旧应用程序,该应用程序公开了 6 个具有不同名称空间的不同 SOAP Web 服务。当我们使用通过其生成的 wsdl 获取的端点时,一切似乎都正常工作。

这是一个示例请求

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:pres="http://MY_NAMESPACE.com">
   <soapenv:Body>
      <pres:UpdateXXXRequest>
      </pres:UpdateXXXRequest>
   </soapenv:Body>
<soapenv:Envelope>

但是有一些客户端以以下格式发送请求

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:pres="http://MY_NAMESPACE.com">
   <soapenv:Body>
      <q0:UpdateXXXRequest xmlns:q0="http://schemas.xmlsoap.org/soap/envelope/">
      </q0:UpdateXXXRequest>
   </soapenv:Body>
<soapenv:Envelope

此请求导致错误 No Endpoint Found 由于名称空间 xmlns:q0="http://schemas.xmlsoap.org/soap/envelope/" 使用有效载荷 UpdateXXXRequest。

根据我的分析,Spring 框架使用 EndpointMapping 来识别相应的方法,然后根据命名空间调用服务(使用主体负载 q0:UpdateXXXRequest xmlns:q0 ="http://schemas.xmlsoap.org/soap/envelope/" 或来自s​​oapenv:Envelop)

{http://schemas.xmlsoap.org/soap/envelope/}UpdateRxFillRequest 的情况下,它失败了,因为方法是用自己的命名空间定义的,而 spring 只查找用方法定义的命名空间通过@Payload注解。

如果它从 UpdateXXXRequest 中删除 q0 或使用实际的命名空间,它工作正常,但客户端发送请求时使用 http://schemas.xmlsoap.org/soap/envelope/

每种方法支持 http://schemas.xmlsoap.org/soap/envelope/http://MY_NAMESPACE.com 的方式是什么。

虽然我有 100 多个端点。

【问题讨论】:

    标签: java spring-boot soap spring-ws


    【解决方案1】:

    我可以通过将 SOAP 方法上的 @Payload 注释替换为允许添加多个 @Payload 注释的 @Payloads 来解决此问题。我添加了两个服务命名空间为 http://MY_NAMESPACE.com,第二个是 http://schemas.xmlsoap.org/soap/envelope/。 Spring 框架通过这两个注解识别了 SOAP 端点。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-04-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多