new javax.xml.namespace.QName(
"http://wsiftypes.addressbook/",
"phone"),
Class.forName("addressbook.wsiftypes.Phone"));
WSIFPort port = null;
port = service.getPort(portName);
WSIFOperation operation =
port.createOperation("addEntry", "AddEntryWholeNameRequest", null);
WSIFMessage inputMessage = operation.createInputMessage();
WSIFMessage outputMessage = operation.createOutputMessage();
WSIFMessage faultMessage = operation.createFaultMessage();
// Create a name and address to add to the addressbook
String nameToAdd = "Chris P. Bacon";
Address addressToAdd =
new Address(
1,
"The Waterfront",
"Some City",
"NY",
47907,
new Phone(765, "494", "4900"));
// Add the name and address to the input message
inputMessage.setObjectPart("name", nameToAdd);
inputMessage.setObjectPart("address", addressToAdd);
// Execute the operation, obtaining a flag to indicate its success
operation.executeInputOnlyOperation(inputMessage);
// Start from fresh
operation = null;
inputMessage = null;
outputMessage = null;
faultMessage = null;
operation = port.createOperation("getAddressFromName");
// Create the messages
inputMessage = operation.createInputMessage();
outputMessage = operation.createOutputMessage();
faultMessage = operation.createFaultMessage();