RelayUtils { public static void buildMessage(org.apache.axis2.context.MessageContext msgCtx) throws IOException, XMLStreamException { buildMessage(msgCtx, false); }  static void buildMessage(org.apache.axis2.context.MessageContext msgCtx); static void buildMessage(MessageContext messageContext,
                                    boolean earlyBuild);  }
@Test public void testSOAPBodyIsntFullyReadWhenNotUsingBinaryRelayBuilder() throws IOException, XMLStreamException { SOAPEnvelope envelope = OMXMLBuilderFactory .createSOAPModelBuilder(new StringReader(xml)).getSOAPEnvelope(); msgCtx.setEnvelope(envelope); RelayUtils.buildMessage(msgCtx); assertEquals(payloadQName, msgCtx.getEnvelope().getBody().getFirstElement().getQName()); assertFalse(msgCtx.getEnvelope().getBody().isComplete()); }
@Test public void testBinaryRelayPayloadExpandsToOriginalPayload() throws IOException, XMLStreamException { BinaryRelayBuilder builder = new BinaryRelayBuilder(); InputStream stream = new ReaderInputStream(new StringReader(xml), UTF8); OMElement element = builder.processDocument(stream, "text/xml", msgCtx); msgCtx.setEnvelope((SOAPEnvelope)element); RelayUtils.buildMessage(msgCtx); assertEquals(payloadQName, msgCtx.getEnvelope().getBody().getFirstElement().getQName()); assertFalse(msgCtx.getEnvelope().getBody().isComplete()); }