### Question:
PayloadHelper { public static int getPayloadType(SOAPEnvelope envelope) { OMElement el = getXMLPayload(envelope); if (el.getQName().equals(BINARYELT)) { return BINARYPAYLOADTYPE; } else if (el.getQName().equals(TEXTELT)) { return TEXTPAYLOADTYPE; } else if (el.getQName().equals(MAPELT)) { return MAPPAYLOADTYPE; } else { return XMLPAYLOADTYPE; } }  static int getPayloadType(SOAPEnvelope envelope); static int getPayloadType(MessageContext mc); static OMElement getXMLPayload(SOAPEnvelope envelope); static void setXMLPayload(SOAPEnvelope envelope, OMElement element); static void setXMLPayload(MessageContext mc, OMElement element); static DataHandler getBinaryPayload(SOAPEnvelope envelope); static DataHandler getBinaryPayload(MessageContext mc); static void setBinaryPayload(SOAPEnvelope envelope, DataHandler dh); static void setBinaryPayload(MessageContext mc, DataHandler dh); static String getTextPayload(SOAPEnvelope envelope); static String getTextPayload(MessageContext mc); static void setTextPayload(SOAPEnvelope envelope, String text); static void setTextPayload(MessageContext mc, String text); static SimpleMap getMapPayload(SOAPEnvelope envelope); static SimpleMap getMapPayload(MessageContext mc); static void setMapPayload(SOAPEnvelope envelope, SimpleMap map); static void setMapPayload(MessageContext mc, SimpleMap map); static XMLStreamReader getStAXPayload(SOAPEnvelope envelope); static XMLStreamReader getStAXPayload(MessageContext mc); static void setStAXPayload(SOAPEnvelope envelope, XMLStreamReader streamReader); static void setStAXPayload(MessageContext mc, XMLStreamReader streamReader); final static String AXIOMPAYLOADNS; final static QName BINARYELT; final static QName TEXTELT; final static QName MAPELT; final static int XMLPAYLOADTYPE; static final Log log; }### Answer:
@Test public void testGetPayloadType() throws Exception { SOAP11Factory factory = new SOAP11Factory(); SOAPEnvelope envelope = factory.getDefaultEnvelope(); OMElement element = AXIOMUtil.stringToOM("<name><value>Test</value></name>"); envelope.getBody().addChild(element); int type = PayloadHelper.getPayloadType(envelope); Assert.assertEquals("Payload type is mismatching!", 0, type); }