Methods Summary |
---|
private java.lang.String | getSOAPMessageAsString(javax.xml.soap.SOAPMessage msg)
ByteArrayOutputStream baos = null;
String s = null;
try {
baos = new ByteArrayOutputStream();
msg.writeTo(baos);
s = baos.toString();
} catch(Exception e) {
e.printStackTrace();
}
return s;
|
public javax.xml.soap.SOAPMessage | invoke(javax.xml.soap.SOAPMessage req)
System.out.println("invoke: Request: " + getSOAPMessageAsString(req));
SOAPMessage res = null;
try {
res = makeSOAPMessage(helloResponse);
} catch (Exception e) {
System.out.println("Exception: occurred " + e);
}
System.out.println("invoke: Response: " + getSOAPMessageAsString(res));
return res;
|
private javax.xml.soap.SOAPMessage | makeSOAPMessage(java.lang.String msg)
try {
MessageFactory factory = MessageFactory.newInstance();
SOAPMessage message = factory.createMessage();
message.getSOAPPart().setContent((Source)new StreamSource(new StringReader(msg)));
message.saveChanges();
return message;
}
catch (Exception e) {
return null;
}
|