}
return xmlResult;
}
private void invokeAddNumbers() throws RemoteException {
Dispatch jaxbDispatch = null;
JAXBContext jaxbContext = createJAXBContext();
jaxbDispatch = service.createDispatch(portQName, jaxbContext, Service.Mode.PAYLOAD);
ObjectFactory factory = new ObjectFactory();
AddNumbers numbers = new AddNumbers();
int number1 = 10;
int number2 = 20;
numbers.setArg0(number1);
numbers.setArg1(number2);
JAXBElement<AddNumbers> addNumbers = factory.createAddNumbers(numbers);
System.out.printf("\nInvoking addNumbers(%d, %d)\n", number1, number2);
JAXBElement<AddNumbersResponse> response =
(JAXBElement<AddNumbersResponse>) jaxbDispatch.invoke(addNumbers);
AddNumbersResponse result = response.getValue();
System.out.printf("The result of adding %d and %d is %d.\n", number1, number2, result.getReturn());
}