@WebMethod
public String sayHello(String toWhom) {
System.out.println("HelloWorld Hit! " + toWhom);
String results = "";
try {
ServiceInvoker deliveryAdapter;
Message requestMessage;
Message replyMessage = null;
// Create the delivery adapter for the target service (you'd normally cache this!!)...
deliveryAdapter = new org.jboss.soa.esb.client.ServiceInvoker("MyServiceCategory", "MyNativeClientService");
// Create and populate the request message...
requestMessage = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
requestMessage.getBody().add(toWhom); // inject the value from the WS client
// Deliver the request message synchronously - timeout after 20 seconds...
replyMessage = deliveryAdapter.deliverSync(requestMessage, 20000);
if (replyMessage != null) {
results = (String) replyMessage.getBody().get();
} else {
results = "Hello World: " + toWhom + " on " + new java.util.Date();