在 Eclispe 中验证期间出现奇怪的 WSDL 警告:“wsdl:operation 不是请求/响应或单向操作" [英] Strange WSDL warning during validation in Eclispe: "wsdl:operation was not a request/response or one-way operation"

查看:21
本文介绍了在 Eclispe 中验证期间出现奇怪的 WSDL 警告:“wsdl:operation 不是请求/响应或单向操作"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写 WSDL 文件,但无法从 Eclipse 验证器中消除此警告:

I'm writing a WSDL file and I can't get rid of this warning from the Eclipse validator:

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

这是我写的 WSDL 源代码:

This is the WSDL source I wrote:

<?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

Here you can find the complete WSDL file: https://dl.dropboxusercontent.com/u/33459047/StackOverflow/Master.wsdl

我认为问题的根源在于updateManager"操作,但我不知道如何解决.有人能帮助我吗?提前致谢.

I believe that the source of the problem is the operation "updateManager", but I don't know how to fix it. Can someone help me please? Thank you in advance.

推荐答案

一个端点可以支持 4 种操作.来自 WSDL 规范:

An endpoint can support 4 types of operations. From the WSDL specs:

WSDL 具有端点可以支持的四种传输原语:

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 似乎有一条规则,只支持其中两个.来自 WS-I,测试断言:BP2208:

The WS-I Profile seems to have a rule for supporting only two of them. From WS-I, Test Assertion: BP2208:

背景:
对于 wsdl:portType 定义中的候选 wsdl:operation

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

断言描述:
wsdl:operation 元素是 WSDL 请求/响应或单向操作(无通知或请求响应).

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

失败消息:
wsdl:operation 不是请求/响应或单向操作.

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

你的 updateManager 操作是一个 Notification 和从这里你的警告.

Your updateManager operation is a Notification and from here your warning.

清除错误取决于您互操作性合规性需求.您可以忽略警告(这样您的服务就不会 100% 兼容互操作性),也可以通过更改操作类型(这取决于您的应用程序)来修复它.

Clearing the error depends on you interoperability compliance needs. You can either ignore the warning (and then your service won't be 100% interoperability compliant) or you can fix it by changing the operation type (which depends on your application).

这篇关于在 Eclispe 中验证期间出现奇怪的 WSDL 警告:“wsdl:operation 不是请求/响应或单向操作"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆