官术网_书友最值得收藏!

SOAP Faults

Before concluding our discussion on web services and the associated concepts, we should look at the fault handling mechanism of web services. Faults can be returned by web services due to various reasons. For example, if the request message does not conform to the XML schema of web service, the service responds back with a SOAP Fault. The SOAP Fault element is used to carry such faults occurred during web service communication. This element must be included inside body of a SOAP message. A typical SOAP 1.1 Fault message consists of the following child elements:

  • faultcode: The faultcode element is used to define the type of the fault. For example, if the problem of message transmission is due to the server, the associated faultcode is Server. Similarly, we can use VersionMismatch, MustUnderstand and Client error codes as appropriate.
  • faultstring: The faultstring element is intended to provide a human readable explanation about the fault.
  • faultactor: The faultactorelement provides an indication about the responsible party who caused the fault to occur in the message path.
  • detail: The detailelement is used to carry application specific error information related to the body element. For example, if the payload of the SOAP request is unable cannot be processed by web service, the associated response should include the detail element inside the SOAP Fault.

In the case of SOAP v1.2 messaging, faultcode is renamed to Code and faultstring is renamed to Reason. In addition to that, a SOAP v1.2 Fault message can include the optional child elements, Node, Role, and Detail. A detailed explanation of SOAP 1.1 Faults can be found at http://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383507. SOAP 1.2 Faults are explained in detail at http://www.w3.org/TR/soap12-part1/#soapfault.

主站蜘蛛池模板: 繁昌县| 金阳县| 简阳市| 沈丘县| 石门县| 耒阳市| 左云县| 灵武市| 云南省| 南漳县| 达日县| 信阳市| 葵青区| 禹城市| 乐亭县| 随州市| 长子县| 炉霍县| 盘锦市| 丰顺县| 唐山市| 湛江市| 兴海县| 牙克石市| 嘉祥县| 定结县| 双流县| 黔西| 绥棱县| 阳谷县| 恩施市| 大田县| 孝感市| 全南县| 鲁山县| 常山县| 绥棱县| 东乌珠穆沁旗| 潼关县| 西昌市| 大英县|