Unable to find Fault variable in RemoteFault

If you are placing a catch block in your service invocation and trying to catch a system remotefault/bindingfault  , you can have following issues :



1. First , your faultVariable is not having any child element like code,summary and detail which are part of the RuntimeFault. 

2.  Second, when you try to compile the composite, you get below error:
Error(76): WSDL messageType "{http://schemas.oracle.com/bpel/extension}bindingFault" of variable "" is not defined in any of the WSDL files 

Reason for above issues and solution:
The reason why you get this is because when you select the system->RuntimeFault as type of fault in your fault handler, JDeveloper copies a wsdl named RuntimeFault.wsdl  from your <JDEVELOPER_HOME%\\integration\seed\soa\shared\bpel directory to your project and this wsdl contains following msg :

<?xml version="1.0" encoding="UTF-8"?>
<definitions name="RuntimeFault"
             targetNamespace="http://schemas.oracle.com/bpel/extension"
             xmlns:xsd="http://www.w3.org/2001/XMLSchema"
             xmlns="http://schemas.xmlsoap.org/wsdl/">

    <message name="RuntimeFaultMessage">
        <part name="code" type="xsd:string"/>
        <part name="summary" type="xsd:string"/>
        <part name="detail" type="xsd:string"/>
    </message>
</definitions>

And secondly, JDeveloper create the faultVariable in your BPEL file (.bepl) like this :

<variable messageType="bpelx:bindingFault" name="FaultVar"/>

Now if you observe, the RuntimeFault.wsdl is having the message name as "RuntimeFaultMessage" where as
the variable's messageType is messageType="bpelx:bindingFault" and it is this mismatch which is causing the above mentioned two issues .

To get rid of it, simply change the variables msg type from "bpelx:bindingFault" to "bpelx:RuntimeFaultMessage"  and you are good to go with your composite :
 <variable messageType="bpelx:RuntimeFaultMessage" name="FaultVar"/>

Comments

Popular posts from this blog

Difference between Route, Service Callout, Publish

OSB actions in proxy service

XQuery functions that supported by OSB