opClient.addMessageContext(requetMessageContext);
opClient.setOptions(options);
opClient.execute(true);
SOAPEnvelope result = opClient.getMessageContext(
WSDLConstants.MESSAGE_LABEL_IN_VALUE).getEnvelope();
printResult(result);
if (serviceGroupContextId == null)
serviceGroupContextId = getServiceGroupContextId(result);
} else if ("c".equalsIgnoreCase(option)) {
if (serviceGroupContextId == null) {
System.out.println("Error: First operation must be a New one. Please select 'n'");
continue;
}
System.out.print("Enter parameter...");
String paramStr = reader.readLine();
int param = Integer.parseInt(paramStr);
String opStr = null;
if ("+".equals(operation)) {
opStr = "addPrevious";
} else if ("-".equals(operation)) {
opStr = "substractPrevious";
} else if ("*".equals(operation)) {
opStr = "multiplyPrevious";
}
System.out.println("Invoking...");
ServiceClient serviceClient = new ServiceClient();
serviceClient.setOptions(options);
MessageContext requetMessageContext = new MessageContext();
requetMessageContext.setEnvelope(getPreviousRequestEnvelope(opStr, param,
serviceGroupContextId));
OperationClient opClient = serviceClient.createClient(ServiceClient.ANON_OUT_IN_OP);
opClient.addMessageContext(requetMessageContext);
opClient.setOptions(options);
opClient.execute(true);
SOAPEnvelope result = opClient.getMessageContext(
WSDLConstants.MESSAGE_LABEL_IN_VALUE).getEnvelope();
printResult(result);
}