* normal Dispatch<JAXB> input flow
* @throws Exception
*/
public void testJAXBInflow2() throws Exception {
// Get the BlockFactory
JAXBBlockFactory f = (JAXBBlockFactory)
FactoryRegistry.getFactory(JAXBBlockFactory.class);
// Create a jaxb object
ObjectFactory factory = new ObjectFactory();
EchoString jaxb = factory.createEchoString();
jaxb.setInput("Hello World");
JAXBBlockContext context = new JAXBBlockContext(EchoString.class.getPackage().getName());
JAXBIntrospector jbi = JAXBUtils.getJAXBIntrospector(context.getJAXBContext());
QName expectedQName = jbi.getElementName(jaxb);
// On inbound, there will already be a XMLStreamReader (probably from OM)
// which represents the message. We will simulate this with inflow.
StringWriter sw = new StringWriter();
XMLStreamWriter writer = outputFactory.createXMLStreamWriter(sw);
Marshaller marshaller = JAXBUtils.getJAXBMarshaller(context.getJAXBContext());
marshaller.marshal(jaxb, writer);
JAXBUtils.releaseJAXBMarshaller(context.getJAXBContext(), marshaller);
writer.flush();
sw.flush();
StringReader sr = new StringReader(sw.toString());
XMLStreamReader inflow = inputFactory.createXMLStreamReader(sr);
// Create a Block from the inflow.
Block block = f.createFrom(inflow, context, null);
// Assume that we need to find the QName (perhaps to identify the operation and
// determine if handlers are installed). This is not very perfomant since
// it causes an underlying parse of the String...but we need to support this.
QName qName = block.getQName();