【问题标题】:Throw exception from one-way operation单向操作抛出异常
【发布时间】:2011-11-28 06:51:16
【问题描述】:

假设你有以下操作:

void AddCustomer(Customer)

(即一个客户对象作为输入,没有输出)

根据 WS-I BP 1.1,您不能为单向操作定义故障消息 [1]。但是,您可能希望抛出异常,例如,客户是重复的。您将如何实现这一目标?将操作定义为请求/响应,并带有一个表明操作成功的空响应?在我看来不是那么漂亮......也许你知道另一种方式?我的意思是:在 java/.net 程序中,你仍然希望能够为 void-methods 抛出异常......

例子:

<operation name="AddCustomer">
    <input message="tns:AddCustomerRequest"/>
    <output message="tns:AddCustomerResponse"/>
    <fault name="DuplicateCustomer" message="tns:DuplicateFault"/>
</operation>

其中 AddCustomerResponse 将是一个空序列。

[1]http://www.w3.org/TR/wsdl#_porttypes

【问题讨论】:

    标签: exception soap wsdl soa fault


    【解决方案1】:

    根据 wsdl 1 规范,对此没有解决方案。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-03-28
      • 1970-01-01
      • 2020-08-06
      • 1970-01-01
      • 2013-05-24
      • 2019-02-08
      • 2012-07-21
      相关资源
      最近更新 更多