SOA-DIRECTトランスポートを使用した例外処理
Oracle BPELでSOA直接バインディングを使用してスローされたSOAPフォルトを捕捉するには、SOAPフォルトが次のガイドラインに準拠している必要があります。サービスが次のWSDLポートで定義され、http://www.example.org/MyServiceというネームスペースであるとします。
<wsdl:portType name="MyServicePortType">
<wsdl:operation name="Execute">
<wsdl:input message="exp:ExecuteRequestMsg"/>
<wsdl:output message="exp:ExecuteResponseMsg"/>
<wsdl:fault name="executeFault" message="exp:ExecuteFaultMsg"/>
<wsdl:fault name="genericFault" message="exp:GenericFaultMsg"/>
</wsdl:operation>
</wsdl:portType>
SOAPフォルトをスローする際には、WSDLポートで宣言されているフォルトの修飾名を含める必要があります。SOAP 1.1メッセージの場合は、次に示すように、faultcode要素にWSDLポート・フォルトのQNameを含める必要があります。
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault xmlns:ns0="http://www.example.org/MyService">
<faultcode>ns0:genericFault</faultcode>
<faultstring/>
<faultactor/>
<detail>
<GenericFault xmlns="http://www.example.org/FaultInfo">
<FaultInfo>
<ErrorDescription>Error - soap1.1</ErrorDescription>
</FaultInfo>
</GenericFault>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
SOAP 1.2メッセージの場合は、次に示すように、Code/Subcode/Value要素にWSDLポート・フォルトのQNameを含める必要があります。
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header xmlns:exem="http://www.example.org/MyService"/>
<soap:Body xmlns:exem="http://www.example.org/MyService">
<soap:Fault>
<soap:Fault>
<soap:Value>soap:Receiver</soap:Value>
<soap:Subcode>
<soap:Value xmlns:ns1=" soap:value>"="" target="_blank">http://www.example.org/MyService">ns1:genericFault</soap:Value>
</soap:Subcode>
</soap:Code>
<soap:Reason>
<soap:Text xml:lang="pt">Failure calling partner.</soap:Text>
</soap:Reason>
<soap:Node>...</soap:Node>
<soap:Detail>
<err:GenericFault xmlns:err="http://www.example.org/FaultInfo">
<err:FaultInfo>
<err:ErrorDescription>Error Desc</err:ErrorDescription>
</err:FaultInfo>
</err:GenericFault>
</soap:Detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>