// Create the delivery adapter for the target service (cache it)
ServiceInvoker deliveryAdapter = new ServiceInvoker(
"MyServiceCategory", "Webserviceconsumer_wise2");
// Create and populate the request message...
Message requestMessage = MessageFactory.getInstance().getMessage(
MessageType.JBOSS_XML);
ExternalObject external = new ExternalObject();
InternalObject internal = new InternalObject();
internal.setNumber(new Integer(1));
internal.setText(message);
external.setInternal(internal);
String dateString = "2007-03-07T04:27:00";
Date date = (new SimpleDateFormat(DEFAULT_DATE_FORMAT))
.parse(dateString);
external.setDate(date);
requestMessage.getBody().add(external);
// Deliver the request message synchronously - timeout after 20
// seconds...
deliveryAdapter.deliverAsync(requestMessage);
}