Creating Java objects isn't as difficult as it sounds, but if this is your first time doing so it can seem daunting. The process is relatively straightforward.
For the request object:
1. Create Java request object
2. Set values within the object
3. Store the object into an OD variable
4. Let OD make the web service call using the WSOP
For the response object:
1. Retrieve the Java object from the OD variable
2. Get values from within the object
3. Set those values into other OD variables to be used in the Callflow
4. Continue with the OD app flow
Without knowing the specifics of the connection you need to make, I can only provide a general way this code can look. In the Devguide, it mentions to use the requestBegin method, but you can also create a Java Servlet in your flow to house the code. You would have one servlet before the Data node that calls the web service, and one servlet after the Data node. The one before sets request data, the one after retrieves response data.
The below code is taken from an example I provided for another customer.
Request sample Java:
public void servletImplementation(com.avaya.sce.runtimecommon.SCESession mySession) {
// Create the request object
GetEquipmentInfo request = new GetEquipmentInfo();
/* Set values in the request object.
* Typically this involves invoking "setter" methods, that is methods
* that begin with the word "set". Below, this is setEquipmentNumber.*/
request.setEquipmentNumber(0);
/* Set the request object into an OD variable
* The class IProjectVariables contains all OD variables, or you can
* type the variable name in as a text string.
*/
mySession.getVariable(IProjectVariables.REQUEST).getSimpleVariable().setValue(request);
// The web service call will now be made using the stored Java objects
}
Response sample Java:
public void servletImplementation(com.avaya.sce.runtimecommon.SCESession mySession) {
// Get the response object
GetEquipmentInfoResponse response = (GetEquipmentInfoResponse) mySession.getVariableField(IProjectVariables.RETURN_1).getObjectValue();
EquipmentInfo info = response.get_return();
/* Get the individual values from the response object
* Just like you set values using "setter" methods, you access
* values using "getter" methods.
*/
long num = info.getEquipmentNumber();
String msg = info.getErrorMessage();
String language = info.getLanguage();
String sapNum = info.getSapEquipmentNumber();
String serial = info.getSerialNumber();
// Set those values into OD variables
mySession.getVariableField(IProjectVariables.RETURN_1_FIELD_EQUIPMENT_NUMBER).setValue(num);
mySession.getVariableField(IProjectVariables.RETURN_1_FIELD_ERROR_MESSAGE).setValue(msg);
mySession.getVariableField(IProjectVariables.RETURN_1_FIELD_LANGUAGE).setValue(language);
mySession.getVariableField(IProjectVariables.RETURN_1_FIELD_SAP_EQUIPMENT_NUMBER).setValue(sapNum);
mySession.getVariableField(IProjectVariables.RETURN_1_FIELD_SERIAL_NUMBER).setValue(serial);
}
If you are not used to writing Java code, I would suggest looking at examples in the various developer guides available here, as well as using the web for more general Java questions.