exception - 单向操作抛出异常

标签 exception soap wsdl soa fault

假设您有以下操作:

void AddCustomer(Customer)

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

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

例子:

<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

最佳答案

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

关于exception - 单向操作抛出异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7607582/

相关文章:

ios - 如何在调用 SOAP 网络服务时显示图像?

python - 如何使用 Python suds 解析 wsdl 的 xml 内容?

c++ - 重新抛出 const 异常引用

python - 如何在 Python 中指示无效参数?

c++ - 来自异常声明的派生对象类型是否意外?

c# - 从应用程序而非 SoapUI 调用批处理服务时出现 MaxReceivedMessageSize 错误

java - 使用 ksoap2-android SOAP 客户端从 WSDL 生成 Java 以在 Android 上使用?

Android,处理 SQLiteConstraintException

c# - 如何在 Windows 7 上修复 "the server certificate is not configured properly with HTTP.SYS"?

php - NuSOAP - 如何将 HTTP 协议(protocol)设置为 1.1?