O'Reilly logo

J2EE™ and Beyond: Design, Develop, and Deploy World-Class Java™ Software by Art Taylor

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The MoviesOrderService Class: The onMessage Method

The onMessage method shown below is used to handle the incoming messages for movies orders. The method receives the SOAP message as a parameter. By making a call to retrieve the SOAP part of the message and to retrieve the content of the message, we are able to retrieve an XML document that represents the message. Embedded within this XML document (as a subtree) is the XML document which represents our movies order.

Four lines of Java code are then used to convert the source object, an object that implements javax.xml.transform.Source, into a string representation of the XML document. This is done by creating a ByteArrayInputStream and wrapping it with a StreamResult (javax.transform.stream.StreamResult ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required