WSIFMessage inMsg = operation.createInputMessage();
WSIFMessage outMsg = operation.createOutputMessage();
WSIFMessage faultMsg = operation.createFaultMessage();
SimpleDocument_Type sdt = new SimpleDocument_Type();
sdt.setValue("petra");
inMsg.setObjectPart("SimpleDocument", sdt);
boolean ok =
operation.executeRequestResponseOperation(
inMsg,
outMsg,
faultMsg);
assertTrue("operation returned false!!", ok);
Object o = null;
try {
o = outMsg.getObjectPart("SimpleDocument");
assertTrue("response is null!!!", o != null);
} catch (WSIFException e) {
assertTrue("response part 'SimpleDocument' not found in output message!!!", false);
}
assertTrue(
"response part has wrong type: " + o.getClass(),
SimpleDocument_Type.class.isAssignableFrom(o.getClass()));
SimpleDocument_Type response = (SimpleDocument_Type) o;
assertTrue(
"document value wrong: " + response.getValue(),
sdt.getValue().equals(response.getValue()));
} catch (Exception ex) {
ex.printStackTrace();
assertTrue(
"InteropDocTest.doitSimpleDocumentDII("