Understanding WSDL Faults
Consider the WSDL with portType and operations as shown below
< portType name="Sample" >
< operation name="sayHello" >
< input message="tns:sayHello"/ >
< output message="tns:sayHelloResponse"/ >
< /operation >
< operation name="addNum" >
< input message="tns:addNum"/ >
< output message="tns:addNumResponse"/ >
< /operation >
< operation name="subNum" >
< input message="tns:subNum"/ >
< output message="tns:subNumResponse"/ >
< /operation >
< /portType >
" In the above example each operation has input and output message. For each operation we can add the fault message it returns. The message definition is shown below
< message name="SayHelloFaultMessage" >
< part name="error" type="xs:string" / >
< /message >
< message name="AddNumFaultMessage" >
< part name="error" type="xs:string" / >
< /message >
< message name="SubNumFaultMessage" >
< part name="error" type="xs:string" / >
< /message >
After adding the fault the porType is shown below
< portType name="Sample" >
< operation name="sayHello" >
< input message="tns:sayHello"/ >
< output message="tns:sayHelloResponse"/ >
< fault name="fault" message="tns:SayHelloFaultMessage" / >
< /operation >
< operation name="addNum" >
< input message="tns:addNum"/ >
< output message="tns:addNumResponse"/ >
< fault name="fault" message="tns:AddNumFaultMessage" / >
< /operation >
< operation name="subNum" >
< input message="tns:subNum"/ >
< output message="tns:subNumResponse"/ >
< fault name="fault" message="tns:SubNumFaultMessage" / >
< /operation >
< /portType >
Note the following while adding fault:
WSDL does not require that we use unique fault names within the namespace used
to define the operation. In other words, that faults that have the same name and are
defined within the same namespace will be considered as the same fault in BPEL.
Keep this in mind when designing services that can potentially become partners
of BPEL business processes, because this can lead to conflicts in fault handling
during execution.
In the above we have given unique name so that all the faults are considered as different
Consider the WSDL with portType and operations as shown below
< portType name="Sample" >
< operation name="sayHello" >
< input message="tns:sayHello"/ >
< output message="tns:sayHelloResponse"/ >
< /operation >
< operation name="addNum" >
< input message="tns:addNum"/ >
< output message="tns:addNumResponse"/ >
< /operation >
< operation name="subNum" >
< input message="tns:subNum"/ >
< output message="tns:subNumResponse"/ >
< /operation >
< /portType >
" In the above example each operation has input and output message. For each operation we can add the fault message it returns. The message definition is shown below
< part name="error" type="xs:string" / >
< /message >
< message name="AddNumFaultMessage" >
< part name="error" type="xs:string" / >
< /message >
< message name="SubNumFaultMessage" >
< part name="error" type="xs:string" / >
< /message >
After adding the fault the porType is shown below
< portType name="Sample" >
< operation name="sayHello" >
< input message="tns:sayHello"/ >
< output message="tns:sayHelloResponse"/ >
< fault name="fault" message="tns:SayHelloFaultMessage" / >
< /operation >
< operation name="addNum" >
< input message="tns:addNum"/ >
< output message="tns:addNumResponse"/ >
< fault name="fault" message="tns:AddNumFaultMessage" / >
< /operation >
< operation name="subNum" >
< input message="tns:subNum"/ >
< output message="tns:subNumResponse"/ >
< fault name="fault" message="tns:SubNumFaultMessage" / >
< /operation >
< /portType >
Note the following while adding fault:
WSDL does not require that we use unique fault names within the namespace used
to define the operation. In other words, that faults that have the same name and are
defined within the same namespace will be considered as the same fault in BPEL.
Keep this in mind when designing services that can potentially become partners
of BPEL business processes, because this can lead to conflicts in fault handling
during execution.
In the above we have given unique name so that all the faults are considered as different
2 comments:
Java Web Services Online Training | Web Services Course | Web Services Training Courses | Java Web Services Training in Chennai | Java Training in Chennai | Java Training Institutes in Chennai | Java Web Services Interview Questions | Java Web Services Interview Questions
Best Java EE 6 specification training is really good for developers like us Java Online Course Java training Reference Implementation of Java EE6 Java Training in Chennai supported technologies includes Java Training Institutes in Chennai feature/improvements is using Annotations instead of web.xml Advanced Java Training in Chennai
Post a Comment