Any messages arriving
at the HTTP Connector will be directed to the next component in the flow,
namely the HTTP Inspector.
HTTP Interceptor: The HTTP Interceptor is a ServiceMix Transform
Component. This component, as the name implies, will first intercept the
message contents. The XML formatted message sent by the HTTP Client will
be intercepted here, and then printed out to the console. We then unmarshal
the XML instance into a Java instance using the XStream. Next comes the
key sequence in this sample??”we set the Java instance into the InOut of
the message exchange in the next chain of the interaction, to be sent to the
destination service, XStream Inspector.
XStream Inspector: In XStream Inspector, we try to retrieve back the message
content and print it to the console. Then XStream Inspector sends the same
XML content back to the HTTP Interceptor.
In the reverse stream flow, at HTTP Interceptor we again print out the content
received from the XStream Inspector to the console, and then send back the same
XML to the HTTP Client.
The following figure lists how the various code artifacts for the sample are organized:
???
???
???
???
Java XML Binding Using XStream
[ 228 ]
Code HTTPClient
HTTPClient is a normal HTTP Client and is coded in the file ch12\JavaXmlBinding\
Client.
Pages:
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318