gpt4 book ai didi

java - 在 Eclipse : "wsdl:operation was not a request/response or one-way operation" 中验证期间出现奇怪的 WSDL 警告

转载 作者:行者123 更新时间:2023-11-30 08:26:53 25 4
gpt4 key购买 nike

我正在编写一个 WSDL 文件,但我无法摆脱来自 Eclipse validator 的这个警告:

WS-I: (BP2208) wsdl:operation was not a request/response or one-way operation.

这是我写的 WSDL 源代码:

<?xml version="1.0" encoding="UTF-8"?>

<definitions name="Master"
targetNamespace="http://pad.polito.it/ACSAuth"
xmlns:tns="http://pad.polito.it/ACSAuth"

xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns="http://schemas.xmlsoap.org/wsdl/">

<types>
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0"
targetNamespace="http://pad.polito.it/ACSAuth"
xmlns:tns="http://pad.polito.it/ACSAuth">

<xs:element name="AccessDB" type="tns:AccessDBType">
<!-- OMITTED COMPLEX TYPE AccessDBType -->

<xs:element name="passThrough" type="tns:passThroughType"/>
<!-- OMITTED COMPLEX TYPE passThroughType -->

</xs:schema>
</types>

<message name="updatedDB">
<part name="db" element="tns:AccessDB"/>
</message>

<message name="passThroughNotice">
<part name="info" element="tns:passThrough"/>
</message>

<portType name="myPorts">
<operation name="updateManager">
<output name="newUpdate" message="tns:updatedDB"/>
</operation>
<operation name="noticeManager">
<input name="newNotice" message="tns:passThroughNotice"/>
</operation>
</portType>

<binding name="myBindings" type="tns:myPorts">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="updateManager">
<soap:operation soapAction="" />
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="noticeManager">
<soap:operation soapAction="" />
<input>
<soap:body use="literal"/>
</input>
</operation>
</binding>

<service name="MyServices">
<port name="ACSAuth" binding="tns:myBindings">
<soap:address location="http://localhost:8181/ACSAuth"/>
</port>
</service>

</definitions>

在这里您可以找到完整的 WSDL 文件:https://dl.dropboxusercontent.com/u/33459047/StackOverflow/Master.wsdl

我相信问题的根源是操作“updateManager”,但我不知道如何修复它。有人能帮助我吗?提前谢谢你。

最佳答案

端点可以支持 4 种类型的操作。来自WSDL specs :

WSDL has four transmission primitives that an endpoint can support:

  • One-way. The endpoint receives a message.
  • Request-response. The endpoint receives a message, and sends a correlated message.
  • Solicit-response. The endpoint sends a message, and receives a correlated message.
  • Notification. The endpoint sends a message.

WS-I Profile 似乎有一条规则只支持其中的两个。 From WS-I, Test Assertion: BP2208 :

Context:
For a candidate wsdl:operation in a wsdl:portType definition

Assertion Description:
The wsdl:operation element is either a WSDL request/response or a one-way operation (no Notification or Sollicit-Response).

Failure Message:
wsdl:operation was not a request/response or one-way operation.

您的 updateManager 操作是一个 Notification 并从这里发出警告。

清除错误靠你了interoperability compliance需要。您可以忽略该警告(这样您的服务将不会 100% 兼容互操作性),也可以通过更改操作类型(取决于您的应用程序)来修复它。

关于java - 在 Eclipse : "wsdl:operation was not a request/response or one-way operation" 中验证期间出现奇怪的 WSDL 警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21189170/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com