Stylus Studio XML Editor

Table of contents

Appendices

2.3 Interface Fault

Interface Fault

The Interface Fault Component[top]

The Interface Fault Component

A fault is an event that occurs during the execution of a message exchange that disrupts the normal flow of messages.

A fault is typically raised when a party is unable to communicate an error condition inside the normal message flow, or a party wishes to terminate a message exchange. A fault message may be used to communicate out of band information such as the reason for the error, the origin of the fault, as well as other informal diagnostics such as a program stack trace.

An Interface Fault component describes a fault that MAY occur during invocation of an operation of the interface. The Interface Fault component declares an abstract fault by naming it and indicating the contents of the fault message. When and how the fault message flows is indicated by the Interface Operation component [Interface Operation].

The Interface Fault component provides a clear mechanism to name and describe the set of faults an interface may generate. This allows operations to easily identify the individual faults they may generate by name. This mechanism allows the ready identification of the same fault occurring across multiple operations and referenced in multiple bindings as well as reducing duplication of description for an individual fault.

Note that faults other than the ones described in the Interface component can also be generated at run-time, i.e. faults are an open set.

The properties of the Interface Fault component are as follows:

  • {name} REQUIRED. A wsdls:NCName as defined by [ Type].

  • {target namespace} REQUIRED. A wsdls:anyURI, as defined in [ Type].

  • {element} OPTIONAL. A reference to an XML element declaration in the {element declarations} property of [The Definitions Component]. This element represents the content or "payload" of the fault.

  • {features} OPTIONAL. A set of Feature components.

  • {properties} OPTIONAL. A set of Property components.

If a type system NOT based on the XML Infoset [XMLInfoSet] is in use (as considered in [Using Other Schema Languages]) then additional properties would need to be added to the Fault Component (along with extensibility attributes to its XML representation) to allow associating such message types with the message reference.

For each Interface Fault component in the {faults} property of an Interface component, the combination of {name} and {target namespace} properties must be unique.

Interface Fault components are local to Interface components; they cannot be referred to by QName, despite having both {name} and {target namespace} properties. That is, two Interface components sharing the same {target namespace} property but with different {name} properties MAY contain Interface Fault components which share the same {name} property. Thus, the {name} and {target namespace} properties of the Interface Fault components are not sufficient to form the unique identity of an Interface Fault component. To uniquely identify an Interface Fault component one must first identify the Interface component (by QName) and then identify the Interface Fault within that Interface component (by a further QName).

In cases where, due to an interface extending one or more other interfaces, two or more Interface Faults components have the same value for their {name} and {target namespace} properties, then the component models of those Interface Fault components MUST be equivalent (see [Equivalence of Components]). If the Interface Fault components are equivalent then they are considered to collapse into a single component. It is an error if two Interface Fault components have the same value for their {name} and {target namespace} properties but are not equivalent.

Note that, due to the above rules, if two interfaces that have the same value for their {target namespace} property also have one or more faults that have the same value for their {name} property then those two interfaces cannot both form part of the derivation chain of a derived interface unless those faults are the same fault.

NOTE: 

For the above reason, it is considered good practice to ensure, where necessary, that the {name} property of Interface Fault components within a namespace are unique, thus allowing such derivation to occur without inadvertent error.

XML Representation of Interface Fault Component[top]

XML Representation of Interface Fault Component
<definitions>
  <interface>
    <fault
          name="xs:NCName" 
          element="xs:QName"? >
      <documentation />?
      [ <feature /> | <property /> ]*
    </fault>
  </interface>
</definitions>

The XML representation for an Interface Fault component is an element information item with the following Infoset properties:

  • A [local name] of fault

  • A [namespace name] of http://www.w3.org/2004/08/wsdl

  • Two or more attribute information items amongst its [attributes] as follows:

    • A REQUIRED name attribute information item as described below in [ ].

    • An OPTIONAL element attribute information item as described below in [ ].

    • Zero or more namespace qualified attribute information items. The [namespace name] of such attribute information items MUST NOT be http://www.w3.org/2004/08/wsdl.

  • Zero or more element information item amongst its [children], in order, as follows:

    1. An OPTIONAL documentation element information item (see [Documentation]).

    2. Zero or more element information items from among the following, in any order:

name attribute information item with fault [owner][top]

name attribute information item with fault [owner]

The name attribute information item identifies a given fault element information item inside a given interface element information item.

The name attribute information item has the following Infoset properties:

  • A [local name] of name

  • A [namespace name] which has no value

The type of the name attribute information item is xs:NCName.

element attribute information item with fault [owner][top]

element attribute information item with fault [owner]

The element attribute information item refers, by QName, to an element declaration component.

The element attribute information item has the following Infoset properties:

  • A [local name] of element.

  • A [namespace name] which has no value.

The type of the element attribute information item is xs:QName.

Mapping Interface Fault's XML Representation to Component Properties[top]

Mapping Interface Fault's XML Representation to Component Properties

The mapping between the properties of the Interface Fault component (see [The Interface Fault Component]) and the XML Representation of the fault element information item (see [XML Representation of Interface Fault Component]) is as described in [tab_InterfaceFault_Mapping].

1tab_InterfaceFault_Mapping Mapping between Interface Fault Component Properties and XML Representation Property Mapping
11{name} 11The actual value of the name attribute information item.
11{target namespace} 11 The actual value of the targetNamespace attribute information item of the [parent] definitions element information item of the [parent] interface element information item.
11{element} 11 The element declaration from the {element declarations} property of [The Definitions Component] resolved to by the value of the element attribute information item if present, otherwise empty. It is an error for the element attribute information item to have a value and for it to not resolve to a global element declaration from the {element declarations} property of [The Definitions Component].
11{features} 11 The set of Feature components corresponding to the feature element information items in [children], if any.
11{properties} 11 The set of Property components corresponding to the property element information items in [children], if any.