transform02.contentString = " + contentString);
payLoad = (ServiceParamTO)
XStreamUtil.xmlToObject(contentString);
xStream = new XStream();
xStream.alias("ServiceParamTO", ServiceParamTO.class);
xStream.alias("CustomerTO", CustomerTO.class);
xStream.alias("CreditCardTO", CreditCardTO.class);
xStream.alias("AddressTO", AddressTO.class);
javaSource = new XStreamSource(payLoad, xStream);
service = new QName(namespaceURI, localPart);
inOut = createInOutExchange(service, null, null);
Chapter 12
[ 231 ]
normalizedMessageIn = inOut.createMessage();
normalizedMessageIn.setContent(javaSource);
inOut.setInMessage(normalizedMessageIn);
sendSync(inOut);
normalizedMessageOut = inOut.getOutMessage();
copyReturnMessage = exchange.createMessage();
getMessageTransformer().transform(exchange,
normalizedMessageOut, copyReturnMessage);
contentReturn = copyReturnMessage.getContent();
if (contentReturn instanceof StringSource)
{
try
{
inputStream = ((StringSource)contentReturn).
getInputStream();
available = inputStream.available();
bytes = new byte[available];
inputStream.read(bytes);
}
catch(IOException ioException)
{
throw new MessagingException(ioException);
}
contentReturnString = new String(bytes);
System.
Pages:
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322