There are two examples below, one each for the two situations I mentioned.
First, this is an example of invoking a web service using Java. In order to get all the objects into the project, you'll have to first go ahead and create the WSOP using the WSDL. Once that's done, you can delete the WSOP, since you won't be using it, but the beans directory will still remain. To print out, I used OD's log() method, which prints out only if tracing is enabled and uses Apache servlet logging. You could write out using other means if you wish, such as to a file.
public void servletImplementation(com.avaya.sce.runtimecommon.SCESession mySession) {
log("Start of WS call...");
QueryResourcesRequest request = new QueryResourcesRequest();
request.setQueryResourcesRequestUnused(1234);
try {
AppIntfWSStub stub = new AppIntfWSStub();
QueryResourcesResponse response = stub.queryResources(request);
mySession.getVariableField(IProjectVariables.TOTAL_RES__RETURNED).setValue(response.getTotalRes_returned());
mySession.getVariableField(IProjectVariables.UNUSED_H_3_2_3__RETURNED).setValue(response.getUnusedH323_returned());
mySession.getVariableField(IProjectVariables.UNUSED_SIP__RETURNED).setValue(response.getUnusedSIP_returned());
log("Unused SIP Return value: " + response.getUnusedSIP_returned());
} catch (RemoteException e) {
e.printStackTrace();
} catch (QueryResourcesFaultException e) {
e.printStackTrace();
}
}
This is a portion of the log that gets generated for that app. The app itself doesn't do much, so there isn't much, but you can see the log entries for the above code. I only printed out one value, so you can modify it to fit your needs.
...
04/03/2014 16:47:56:306 INFO - 60C70BBC8C63A11290BEECDEFF4FDEA6:/err : Storing :session___sharedmode to complex: session:sharedmode as [shared]
04/03/2014 16:47:56:306 INFO - 60C70BBC8C63A11290BEECDEFF4FDEA6:/err : Storing :shareduui___value to complex: shareduui:value as [unknown]
04/03/2014 16:47:56:306 INFO - 60C70BBC8C63A11290BEECDEFF4FDEA6:/err : Storing :session___vpcoveragetype to complex: session:vpcoveragetype as [unknown]
04/03/2014 16:47:56:307 INFO - 60C70BBC8C63A11290BEECDEFF4FDEA6:/err : Storing :shareduui___id to complex: shareduui:id as [unknown]
04/03/2014 16:47:56:364 INFO - 60C70BBC8C63A11290BEECDEFF4FDEA6:/err : Using SCESession 60C70BBC8C63A11290BEECDEFF4FDEA6:/err servlet : untitledServlet1
Mar 04, 2014 4:47:56 PM org.apache.catalina.core.ApplicationContext log
INFO: untitledServlet1: Start of WS call...
Mar 04, 2014 4:47:57 PM org.apache.catalina.core.ApplicationContext log
INFO: untitledServlet1: Unused SIP Return value: 56
04/03/2014 16:47:57:092 INFO - 60C70BBC8C63A11290BEECDEFF4FDEA6:/err : Using SCESession 60C70BBC8C63A11290BEECDEFF4FDEA6:/err servlet : untitledReturn1
04/03/2014 16:47:57:144 DEBUG - 60C70BBC8C63A11290BEECDEFF4FDEA6:/err : *** Reply for [/err/untitledReturn1] ***
04/03/2014 16:47:57:145 DEBUG - 60C70BBC8C63A11290BEECDEFF4FDEA6:/err : 0:<?xml version="1.0" encoding="UTF-8"?>
...
Second, this is the option to use a Java object with the WSOP. Like mentioned before, to create the WSOP, you need to uncheck the Unwrap input/output parameter check boxes. Also make sure that on the last two pages of the wizard, you check Use Java Object for input and output. I used 2 servlets, one before the Data node, one after.
Request servlet
public void servletImplementation(com.avaya.sce.runtimecommon.SCESession mySession) {
log("Setting request object for WS call.");
DebitCardRequest request = new DebitCardRequest();
DebitCardRequestDataType param = new DebitCardRequestDataType();
request.setDebitCardRequest(param);
mySession.getVariableField(IProjectVariables.QUERY_RESOURCES_REQUEST).setValue(request);
}
Response servlet
public void servletImplementation(com.avaya.sce.runtimecommon.SCESession mySession) {
Object obj = mySession.getVariableField(IProjectVariables.QUERY_RESOURCES_RESPONSE).getObjectValue();
FinancialTransResponse response = (FinancialTransResponse) obj;
log("Response from WS:\n" +
"Code - " + response.getFinancialTransResponse().getResponseCode().getRespCodeType() +
"\nProcessing - " + response.getFinancialTransResponse().getProcessingCode().getProcessingCodeType() +
"\nRmType - " + response.getFinancialTransResponse().getRrn().getRrnType());
}
For this second method, make sure that SOAP tracing isn't set to be on in ddrt.properties. The console output snippet for this looks something like this:
...
04/03/2014 17:20:35:850 INFO - 0102BF377427B612C3A5524046A22446:/err : Storing :shareduui___value to complex: shareduui:value as [unknown]
04/03/2014 17:20:35:850 INFO - 0102BF377427B612C3A5524046A22446:/err : Storing :session___vpcoveragetype to complex: session:vpcoveragetype as [unknown]
04/03/2014 17:20:35:850 INFO - 0102BF377427B612C3A5524046A22446:/err : Storing :shareduui___id to complex: shareduui:id as [unknown]
Mar 04, 2014 5:20:35 PM org.apache.catalina.core.ApplicationContext log
INFO: untitledServlet2: Setting request object for WS call.
04/03/2014 17:20:35:935 INFO - 0102BF377427B612C3A5524046A22446:/err : Using SCESession 0102BF377427B612C3A5524046A22446:/err servlet : untitledData1
04/03/2014 17:20:36:777 DEBUG - 0102BF377427B612C3A5524046A22446:/err : Collecting [connectivity.ws.beans.DebitCardRequest@54a3ae71] from:QueryResourcesRequest
04/03/2014 17:20:36:061 INFO - 0102BF377427B612C3A5524046A22446:/err : Calling Web Service [SvGate] at [http://likewow777-surf:8088/mockSvGateSOAP] operation [debitCard]
04/03/2014 17:20:36:777 DEBUG - 0102BF377427B612C3A5524046A22446:/err : Storing [connectivity.ws.beans.FinancialTransResponse@f2168386] to:QueryResourcesResponse
Mar 04, 2014 5:20:36 PM org.apache.catalina.core.ApplicationContext log
INFO: untitledServlet1: Response from WS:
Code - 888
Processing - 1
RmType - Debit
04/03/2014 17:20:36:850 DEBUG - 0102BF377427B612C3A5524046A22446:/err : *** Reply for [/err/untitledData1] ***
04/03/2014 17:20:36:850 DEBUG - 0102BF377427B612C3A5524046A22446:/err : 0:<?xml version="1.0" encoding="UTF-8"?>
1:<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml" xml:lang="en-us">
2:<meta name="author" content="Avaya Aura Orchestration Designer"/>
...