This documentation is archived and is not being maintained.

<fault> Element

Defines the policy for SOAP messages that are sent by a specific Web service method at an endpoint when there is a fault.

<policyDocument> Element
  <mappings> Element
    <endpoint> Element
      <operation> Element
        <policyDocument> Element
          <mappings> Element
            <endpoint> Element
              <defaultOperation> Element

<fault policy="policy name" />

Attributes

Attribute Description

policy

Required attribute. The ID of the policy to apply to SOAP responses sent by the operation. The ID is preceded by a number sign (#).

Child Elements

None

Parent Elements

Element Description

<operation> Element

Defines the policy for SOAP messages sent to or received by a specific Web service method at an endpoint.

<defaultOperation> Element

Defines the default policy to apply for SOAP messages that match the criteria in the enclosing <endpoint> Element element.

The enclosing <operation> Element element can contain zero or one <fault> elements. Each <fault> element specifies the ID of the policy to apply to faults sent by the operation.

To apply the policy to a SOAP message, the policy attribute must match the wsu:Id attribute of the <Policy> Element (WSE for Microsoft .NET) (1) element, the SOAP action must match the requestAction attribute of the <operation> element, and the WS-Addressing <to> element must match the uri attribute of the <endpoint> Element element.

The following code example defines a policy assertion named signed-body-x509 that requires the digital signing of the <Body> element, timestamp header, and all addressing headers by an X509SecurityToken. The policy file then specifies that SOAP messages adhere to the policy assertion if there is a fault at the http://www.cohowinery.com/Service1.asmx endpoint with a SOAP action of http://www.cohowinery.com/AddNumbers.

Note:
This code example is designed to demonstrate WSE features and is not intended for production use.

<?xml version="1.0" encoding="utf-8"?>
<policyDocument xmlns="http://schemas.microsoft.com/wse/2003/06/Policy">
  <mappings>
    <endpoint uri="http://www.cohowinery.com/Service1.asmx">
      <operation requestAction="http://www.cohowinery.com/AddNumbers">
        <request policy=" " />
        <response policy="" />
        <fault policy="#signed-body-x509" />
      </operation>
    </endpoint>
  </mappings>
  <policies xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
            xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
            xmlns:wse="http://schemas.microsoft.com/wse/2003/06/Policy"
            xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"
            xmlns:wssp="http://schemas.xmlsoap.org/ws/2002/12/secext"
            xmlns:wsp="http://schemas.xmlsoap.org/ws/2002/12/policy"
            xmlns:wssc="http://schemas.xmlsoap.org/ws/2004/04/sc"
            xmlns:rp="http://schemas.xmlsoap.org/rp">
    <!--This policy requires that the body be digitally signed by an X509 security token.-->
    <wsp:Policy wsu:Id="signed-body-x509">
      <wssp:Integrity wsp:Usage="wsp:Required">
        <wssp:TokenInfo>
          <wssp:SecurityToken>
            <wssp:TokenType>http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3</wssp:TokenType>
          </wssp:SecurityToken>
        </wssp:TokenInfo>
        <wssp:MessageParts xmlns:rp="http://schemas.xmlsoap.org/rp"
          Dialect="http://schemas.xmlsoap.org/2002/12/wsse#part">wsp:Body() wse:Timestamp() wse:Addressing()</wssp:MessageParts>
      </wssp:Integrity>
    </wsp:Policy>
  </policies>
</policyDocument>
Show: