32
Exception Handling for remote fault: For handling remote fault first we need one service.. So I am creating AdditionNumber service for invoking . SynchAdditionNumbers:

Exceptionhandling4remote fault

Embed Size (px)

Citation preview

Exception Handling for remote fault:

For handling remote fault first we need one service..

So I am creating AdditionNumber service for invoking.

SynchAdditionNumbers:

Modify xsd as per ur requirement…

Apply and ok…

Deploy the application

After testing the above application it will generate the endpoint url and wsdl…we need wsdl for next

process …so please copy the wsdl

For example

Wsdl address:

http://localhost:8001/soa-

infra/services/default/SynchAdditionNumbers/sunchadditionnumbers_client_ep?WSDL

step2)

I am developing new project:

Modify xsd as per ur requirement…

Now take a webservice component into composite.xml and configure with addition wsdl. After

configuring the webservice component wire the BPEL to webservice component

Click ok…

Make a wire to ur bpel to webservice…

Now your Composite.xml file should look like below:

Now go to BEPL and drag a scope activity between receiveInput and replyOutput activities and name it

as scope_add.

Now your BPEL should look like below:

Now expand scope add invoke,transformation,assign activities to complete the functionality of invoking

the addition service.

Now your BPEL should look like below:

Make a wire to invoke to ur service reference…In mean while of wiring create two variables…

After using transformation activity assign input variable values to invoke_1_process_inputvariable….

Save all and close…

Finally it should look like this

Now make , deploy and test the application from em console.

Now you will be getting proper output.

Now let us un deploy the SynchAdditionNumbers service to raise the remoteFault.

Undeployment process:

In em console right click on the service /SOA Deployment/Undeploy as shown below:

There is a shutdown tab…

After this u can see diabled Test tab

Now go back to ExceptionHandling demoRemotefault service and retest the service. This time you will

be getting fault as shown below:

Close the message.

Now go and examine the instance execution details.

Go to ExceptionhandlingdemoRemotefaultProcessor Bpel and expand the Payload after the invoke

activity as shown below:

The fault occurred is remoteFault.

Now go back to jdeveloper to add fault handling functionality for remoteFault.

Select the scope_add and click on add catch branch as shown below:

This will adds the catch branch as shown below:

Now we have to configure it to handle remoteFault. To do this double click on the catch branch just now

added.

This will launches the catch configuration window as shown below:

Expand system faults and select remoteFault as shown below:

Click on OK.

Now your catch branch configuration will look like below:

Now click on + symbol to create the fault variable. The variable will be created automatically .The

variable will holds the faults details.

Now click on Ok.

Now your BPEL will look like below:

Now expand the remoteFault catch branch and drag and assign activity into the branch and provide

some message “remoteFault is caught” to output variable.

Now your catch branch will look like below:

Make a wire to reply to source..like this

Now make,deploy and test the application.

Now you will be getting “remoteFault is caught” as output.