This is for people who like would like to use WSIF on Oracle BPEL Process manager but cannot find a step by step tutorial on how to do it. A lot of these steps are very manual and I am sure that there is probably an easier (automated) way to do this, which someone will post somewhere. For more information on WSIF please go to http://ws.apache.org/wsif/. This tutorial is based on:
- Matjaž B. Jurič, book chapter “Using WSIF for integration”: http://www.javaworld.com/javaworld/jw-12-2006/jw-1222-bpel.html
- 702. Bindings/JavaBindings in BPEL process manager tutorials folder: http://www.oracle.com/technology/products/ias/bpel/index.html
Step 1
The first thing to do is to create an empty business process called PersonProcess in JDeveloper and then create a new WSDL called PersonHelperService and save into the project BPEL folder. Make sure your definitions are the same as below:

The first thing you must put in the WSDL is the schema that you will be using for message passing. For this example I have create a basic schema which creates two types; a PersonType which consists of two strings and a PersonsType which is a PersonType. I’m sorry these aren’t very clear as they are based on my understanding of the Oracle tutorial.

Step2
The next thing to do is create the messages in the WSDL that will pass in a PersonsType from the schema and return the same type:

You then create the port type which defines an operation which has input and output of these message types:

Next you have the binding which states what binding you will use, the types that will be used and the methods that will be called in the Java class.

Next is the service definition:

And finally the partnerlink information for the business process:

Step 3
Once you have written the WSDL you must then create XML Facades from the schema which will be in the WSDL (see “Using WSIF for integration” for more details. To do this you open the Developer prompt for Oracle and navigate the BPEL folder in the business process project. You must then use the schemac command on the PersonHelperService.wsdl file you have created. This then creates java class files based on the schema from the WSDL file into the folder. This then creates java class files based on the schema from the WSDL file into the folder. One thing to note is that you must use complex types when using the schemac command.

To see what the methods are available see step 6 which shows how to generate javadoc documentation.
Step 4
The next thing to do is to create the business process that will use the PersonHelperService.wsdl file to create a partnerlink which will call a class that you will create later. For this example all I have done is create a simple process that:
- Takes an input which is the same as the schema (see stage 4)
- It then assigns the input as the input for the call (using a copy operation)
- Makes a call to the partnerlink service
- Performs a copy operation from the message received to the output variable
- Makes the call back to the client
Here is the way in which I created the business process using JDeveloper:
1. Pulled across an assign from the component palette and put this under the recieveinput
2. Pulled across an invoke from the component palette and put this under the assign
3.Pulled across an assign from the component palette and put this under the invoke
4. Created a new partnerlink and located this under the project WSDL making sure that the partnerRole is chosen (only one should come up).

Now here it gets a bit messy (my understanding) – when you create a new business process it normally takes and returns a string but for this we need it take and return the same schema types as the ‘service’ that is defined by the PersonHelperService.wsdl. Therefore you need to change the WSDL file of the process itself. You need to open the process WSDL file and make the following addition to the types section:

I’m not sure why you need the extra elements but this is how the 702.Bindings WSDL is formed and it works. This should now reflect the types that the PersonHelperService.wsdl expects. You will also need to change the message type definitions to reflect these changes:

Finally, add: xmlns:types=http://services.otn.com/ to the definitions section.
5. Create the link between the invoke and PersonHelperService partnerlink making sure that you create the input and output variables.
6. Now you can must go into the first assign box and create a copy operation that takes the input payload (persons) and a copies this to the ‘service’ invoke variable payload (personsType). Make sure that the types in brackets are correct by checking the ‘show detailed node information’ checkbox.
7. You must then perform the same copy operation but from the ‘service’ call output variable to the process output variable. Again you should check the types to make sure they are correct.

Step 5 – create the class to be called
The first thing you need to do is create a folder called src in the main process folder (not BPEL folder) to put the java file in and then create the java file (PersonHelperService.java). It should have the same name as the binding section of the PersonHelperService.wsdl, in this case it is so the class is called: PersonHelperService. Here is the class:
package com.otn.services;
import com.otn.services.*;
public class PersonHelperService {
public PersonsType addPerson(PersonsType person) {
System.out.println(” Person = ” + person);
return person;
}
}
First you must say which package it will be in, here it is: com.otn.services. Also, everything is imported from this package which means that you have access to the façade classes you created previously (as they get compiled there later on).Then you must define the method which corresponds to the binding section of the WSDL in this case it is: so the method is called addperson. The binding section states that which means the method must take the PersonsType and also return a PersonsType. There is also a system.out.println method just to make sure everything has worked ok.
Step 6 – create the pre-build
Before you build the project you need to make sure that the java file you have created and the schema classes are compiled into the same directory where the process can see them.

This file needs to be saved as pre-build.xml under the main process folder along with the build.xml. Also notice that in the pre-build there is an attribute named doc that is followed by destination folder. This is useful as it documents the façade classes, letting you know what methods are available. Here is how your application structure should look in JDeveloper:

Step 7 – deploy
To ensure these are compiled into the correct directory you must create the following directory hierarchy under the process folder: $home/system/classes/com/otn/services. I haven’t used JDeveloper as I am having trouble with it but with the Developer prompt simply go to the folder where the build.xml file is and enter the word obant and this should do the work for. Assuming that everything is ok you should have a build with no errors.
Stage 8 – test
Below is the output from a call to the class from the business process:

You should also get some output on the BPEL server.
Conclusion
This is by no means a polished tutorial but is more of a guide for getting to grips with the WSIF on Oracle BPEL process manager. Please feel free to ask any questions or give advice where I have misunderstood anything. Hope this helps.