Methods Summary |
---|
public static void | main(java.lang.String[] args)
if (args.length != 1) {
usage();
}
try {
// Build the message
MessageFactory messageFactory = MessageFactory.newInstance();
SOAPMessage message = messageFactory.createMessage();
// Print the message.
printMessage(message);
// Get a SOAPConnection
SOAPConnectionFactory connFactory = SOAPConnectionFactory.newInstance();
SOAPConnection conn = connFactory.createConnection();
// Send the message
SOAPMessage reply = conn.call(message, args[0]);
// Display the reply
printMessage(reply);
// Close the connection
conn.close();
} catch (Exception ex) {
System.out.println(ex);
}
|
private static void | printHeaders(javax.xml.soap.MimeHeaders headers)
printHeaders(headers.getAllHeaders());
|
private static void | printHeaders(java.util.Iterator iter)
while (iter.hasNext()) {
MimeHeader header = (MimeHeader)iter.next();
System.out.println("\t" + header.getName() + ": " + header.getValue());
}
|
private static void | printMessage(javax.xml.soap.SOAPMessage message)
if (message != null) {
// Get the MIME headers and print them
System.out.println("Headers:");
if (message.saveRequired()) {
message.saveChanges();
}
MimeHeaders headers = message.getMimeHeaders();
printHeaders(headers);
// Print the message itself
System.out.println("\nMessage:");
message.writeTo(System.out);
System.out.println();
}
|
public static void | usage()
System.err.println("Usage: java EmptyMessageClient address");
System.exit(1);
|