Examples of createMessage()


Examples of javax.jms.Session.createMessage()

      // load the queue

      Connection c = cf.createConnection();
      Session s = c.createSession(false, Session.AUTO_ACKNOWLEDGE);
      MessageProducer prod = s.createProducer(queue);
      Message m = s.createMessage();
      prod.send(m);
      c.close();

      final Result result = new Result();
      Connection conn = cf.createConnection();
View Full Code Here

Examples of javax.jms.Session.createMessage()

      MessageConsumer cons2 = sess.createConsumer(topic, selector2);
      MessageConsumer cons3 = sess.createConsumer(topic, selector3);
      MessageConsumer cons4 = sess.createConsumer(topic, selector4);
      MessageConsumer cons5 = sess.createConsumer(topic, selector5);

      Message m1 = sess.createMessage();
      m1.setStringProperty("beatle", "john");

      Message m2 = sess.createMessage();
      m2.setStringProperty("beatle", "paul");
View Full Code Here

Examples of javax.jms.Session.createMessage()

      MessageConsumer cons5 = sess.createConsumer(topic, selector5);

      Message m1 = sess.createMessage();
      m1.setStringProperty("beatle", "john");

      Message m2 = sess.createMessage();
      m2.setStringProperty("beatle", "paul");

      Message m3 = sess.createMessage();
      m3.setStringProperty("beatle", "george");
View Full Code Here

Examples of javax.jms.TopicSession.createMessage()

        pcf.setConnectionFactory(new ActiveMQConnectionFactory("vm://test"));

        connection = (TopicConnection) pcf.createConnection();
        TopicSession session = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
        TopicPublisher publisher = session.createPublisher(topic);
        publisher.publish(session.createMessage());
    }

    @Override
    protected void tearDown() throws Exception {
        if (connection != null) {
View Full Code Here

Examples of javax.wsdl.Definition.createMessage()

        Definition def = WSDLFactory.newInstance().newDefinition();
        def.setTargetNamespace("http://porttype.test");
        def.addNamespace("tns", "http://porttype.test");
        def.addNamespace("xsd", "http://www.w3.org/2000/10/XMLSchema");
        def.addNamespace("w", "uri:hello");
        Message inMsg = def.createMessage();
        inMsg.setQName(new QName("http://porttype.test", "InMessage"));
        inMsg.setUndefined(false);
        Part part1 = def.createPart();
        part1.setName("part1");
        if (rpc) {
View Full Code Here

Examples of javax.xml.soap.MessageFactory.createMessage()

        String str="<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:wsdl=\"http://www.jboss.org/bpel/examples/wsdl\">"+
          "<soapenv:Header/><soapenv:Body><wsdl:hello><TestPart>Hello</TestPart></wsdl:hello></soapenv:Body></soapenv:Envelope>";

        java.io.InputStream is=new java.io.ByteArrayInputStream(str.getBytes());
       
        SOAPMessage soapReq1 = factory.createMessage(null, is);
       
        System.out.println("Invoking server through Dispatch interface using SOAPMessage");
        SOAPMessage soapResp = dispatcher.invoke(soapReq1);
       
        String result=soapResp.getSOAPBody().getTextContent();
View Full Code Here

Examples of javax.xml.soap.MessageFactory.createMessage()

       
        String str="<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:wsdl=\"http://www.jboss.org/bpel/examples/wsdl\">"+
            "<soapenv:Header/><soapenv:Body><wsdl:hello><TestPart>Hello</TestPart></wsdl:hello></soapenv:Body></soapenv:Envelope>";
        java.io.InputStream is=new java.io.ByteArrayInputStream(str.getBytes());
       
        SOAPMessage soapReq1 = factory.createMessage(null, is);
       
          System.out.println("Invoking server through Dispatch interface using SOAPMessage");
          SOAPMessage soapResp = dispatcher.invoke(soapReq1);
          System.out.println("Response from server: " + soapResp.getSOAPBody().getTextContent());
         
View Full Code Here

Examples of javax.xml.soap.MessageFactory.createMessage()

        objectCtx.put(ObjectMessageContext.MESSAGE_INPUT, Boolean.FALSE);
        objectCtx.put(MESSAGE_OUTBOUND_PROPERTY, Boolean.TRUE);
        SOAPMessageContext context = (SOAPMessageContext)sb.createBindingMessageContext(objectCtx);

        MessageFactory msgFactory = MessageFactory.newInstance();
        SOAPMessage msg = msgFactory.createMessage();
        msg.setProperty(SOAPMessage.WRITE_XML_DECLARATION, "true");
        msg.getSOAPPart().getEnvelope().addNamespaceDeclaration(W3CConstants.NP_SCHEMA_XSD,
                                                                W3CConstants.NU_SCHEMA_XSD);
        msg.getSOAPPart().getEnvelope().addNamespaceDeclaration(W3CConstants.NP_SCHEMA_XSI,
                                                                W3CConstants.NU_SCHEMA_XSI);
View Full Code Here

Examples of javax.xml.soap.MessageFactory.createMessage()

        TestClientBinding clientBinding = new TestClientBinding(bus, epr);
        SOAPMessageContext soapCtx = new SOAPMessageContextImpl(new GenericMessageContext());

        InputStream is =  getClass().getResourceAsStream("resources/NoSuchCodeDocLiteral.xml");
        MessageFactory msgFactory = MessageFactory.newInstance();
        SOAPMessage faultMsg = msgFactory.createMessage(null,  is);
        soapCtx.setMessage(faultMsg);
        assertTrue(clientBinding.getBindingImpl().hasFault(soapCtx));
       
        is =  getClass().getResourceAsStream("resources/GreetMeDocLiteralReq.xml");
        faultMsg = msgFactory.createMessage(null,  is);
View Full Code Here

Examples of javax.xml.soap.MessageFactory.createMessage()

        SOAPMessage faultMsg = msgFactory.createMessage(null,  is);
        soapCtx.setMessage(faultMsg);
        assertTrue(clientBinding.getBindingImpl().hasFault(soapCtx));
       
        is =  getClass().getResourceAsStream("resources/GreetMeDocLiteralReq.xml");
        faultMsg = msgFactory.createMessage(null,  is);
        soapCtx.setMessage(faultMsg);
        assertFalse(clientBinding.getBindingImpl().hasFault(soapCtx));
    }

    public void testRead() throws Exception {
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.