Examples of EmptyMessageImpl


Examples of com.sun.xml.ws.message.EmptyMessageImpl

    /**
     * Creates a {@link Message} that doesn't have any payload.
     */
    public static Message createEmpty(SOAPVersion soapVersion) {
        return new EmptyMessageImpl(soapVersion);
    }
View Full Code Here

Examples of com.sun.xml.ws.message.EmptyMessageImpl

        public Object getPayload(JAXBContext context) {
            return null;
        }

        public Message getMessage(HeaderList headers, AttachmentSet attachments, WSBinding binding) {
            return new EmptyMessageImpl(headers,attachments,binding.getSOAPVersion());
        }
View Full Code Here

Examples of com.sun.xml.ws.message.EmptyMessageImpl

        public Object getPayload(BindingContext context) {
            return null;
        }

        public Message getMessage(MessageHeaders headers, AttachmentSet attachments, WSBinding binding) {
            return new EmptyMessageImpl(headers,attachments,binding.getSOAPVersion());
        }
View Full Code Here

Examples of com.sun.xml.ws.message.EmptyMessageImpl

     *      The SOAP version of the message. Must not be null.
     */
    public static Message createUsingPayload(Source payload, SOAPVersion ver) {
        if (payload instanceof DOMSource) {
            if (((DOMSource)payload).getNode() == null) {
                return new EmptyMessageImpl(ver);
            }
        } else if (payload instanceof StreamSource) {
            StreamSource ss = (StreamSource)payload;
            if (ss.getInputStream() == null && ss.getReader() == null && ss.getSystemId() == null) {
                return new EmptyMessageImpl(ver);
            }
        } else if (payload instanceof SAXSource) {
            SAXSource ss = (SAXSource)payload;
            if (ss.getInputSource() == null && ss.getXMLReader() == null) {
                return new EmptyMessageImpl(ver);
            }
        }
        return new PayloadSourceMessage(payload, ver);
    }
View Full Code Here

Examples of com.sun.xml.ws.message.EmptyMessageImpl

        if(body==null)
            throw new WebServiceException("Message doesn't have <S:Body> "+soapEnvelope);
        Element payload = DOMUtil.getFirstChild(soapEnvelope, ver.nsUri, "Body");

        if(payload==null) {
            return new EmptyMessageImpl(headers, new AttachmentSetImpl(), ver);
        } else {
            return new DOMMessage(ver,headers,payload);
        }
    }
View Full Code Here

Examples of com.sun.xml.ws.message.EmptyMessageImpl

    /**
     * Creates a {@link Message} that doesn't have any payload.
     */
    public static Message createEmpty(SOAPVersion soapVersion) {
        return new EmptyMessageImpl(soapVersion);
    }
View Full Code Here

Examples of net.timewalker.ffmq3.common.message.EmptyMessageImpl

        return sb.toString();
    }
   
    public static EmptyMessageImpl createEmptyMessage() throws JMSException
    {
        EmptyMessageImpl msg = new EmptyMessageImpl();
        setDummyProperties(msg);
        return msg;
    }
View Full Code Here

Examples of net.timewalker.ffmq3.common.message.EmptyMessageImpl

     * (non-Javadoc)
     * @see javax.jms.Session#createMessage()
     */
    public final Message createMessage() throws JMSException
    {
        return new EmptyMessageImpl();
    }
View Full Code Here

Examples of net.timewalker.ffmq3.common.message.EmptyMessageImpl

*/
public class EmptyMessageImplTest extends TestCase
{
  public void testBooleanConversion() throws Exception
  {
    Message msg = new EmptyMessageImpl();
   
    msg.setBooleanProperty("prop", true);
   
    assertTrue(msg.getBooleanProperty("prop"));
    assertEquals("true",msg.getStringProperty("prop"));
   
    try { msg.getByteProperty("prop");   fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
    try { msg.getShortProperty("prop");  fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
    try { msg.getIntProperty("prop");    fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
    try { msg.getLongProperty("prop");   fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
    try { msg.getFloatProperty("prop");  fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
    try { msg.getDoubleProperty("prop"); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
  }
View Full Code Here

Examples of net.timewalker.ffmq3.common.message.EmptyMessageImpl

    try { msg.getDoubleProperty("prop"); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
  }
 
  public void testByteConversion() throws Exception
  {
    Message msg = new EmptyMessageImpl();
   
    msg.setByteProperty("prop", (byte)123);
   
    assertEquals(123,msg.getByteProperty("prop"));
    assertEquals(123,msg.getShortProperty("prop"));
    assertEquals(123,msg.getIntProperty("prop"));
    assertEquals(123,msg.getLongProperty("prop"));
    assertEquals("123",msg.getStringProperty("prop"));
   
    try { msg.getBooleanProperty("prop"); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
    try { msg.getFloatProperty("prop");   fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
    try { msg.getDoubleProperty("prop");  fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.