Package org.jboss.ws.core.soap

Examples of org.jboss.ws.core.soap.MessageFactoryImpl.createMessage()


         "</env:Body>" +
         "</env:Envelope>";
     
      MessageFactoryImpl factory = new MessageFactoryImpl();
      factory.setStyle(Style.DOCUMENT);
      SOAPMessage soapMessage = factory.createMessage(null, new ByteArrayInputStream(envStr.getBytes()));
     
      SOAPContentElement sce = getSOAPContentElement(soapMessage);
     
      //force transition to XML_VALID and set an equivalent XMLFragment (but having a new ns declaration that would overwrite the one in the original fragment)
      sce.setXMLFragment(new XMLFragment("<Foo xmlns='firstNS' xmlns:ns2='secondNs'/>"));
View Full Code Here


      soapBody.getFirstChild().getChildNodes();
     
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      soapMessage.writeTo(baos);
     
      soapMessage = factory.createMessage(null, new ByteArrayInputStream(baos.toByteArray()));
      Node foo = soapMessage.getSOAPBody().getFirstChild();
      assertEquals("firstNS", foo.getNamespaceURI());
   }
  
   private SOAPContentElement getSOAPContentElement(final SOAPMessage soapMessage) throws Exception
View Full Code Here

      CommonBinding binding = (CommonBinding)bindingProvider.getCommonBinding();

      ByteArrayInputStream inputStream = new ByteArrayInputStream(reqEnvelope.getBytes());

      MessageFactory factory = new MessageFactoryImpl();
      SOAPMessageImpl reqMessage = (SOAPMessageImpl)factory.createMessage(null, inputStream);

      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
      msgContext.setSOAPMessage(reqMessage);

      EndpointInvocation epInv = binding.unbindRequestMessage(opMetaData, reqMessage);
View Full Code Here

      paramMetaData.setInHeader(true);

      ByteArrayInputStream inputStream = new ByteArrayInputStream(reqEnvelopeWithBoundHeader.getBytes());

      MessageFactory factory = new MessageFactoryImpl();
      SOAPMessageImpl reqMessage = (SOAPMessageImpl)factory.createMessage(null, inputStream);

      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
      msgContext.setSOAPMessage(reqMessage);

      CommonBindingProvider bindingProvider = new CommonBindingProvider(CommonSOAPBinding.SOAP12HTTP_BINDING, Type.JAXRPC);
View Full Code Here

   public void testUnbindRequestMessageWithUnboundHeader() throws Exception
   {
      ByteArrayInputStream inputStream = new ByteArrayInputStream(reqEnvelopeWithUnboundHeader.getBytes());

      MessageFactory factory = new MessageFactoryImpl();
      SOAPMessageImpl reqMessage = (SOAPMessageImpl)factory.createMessage(null, inputStream);

      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
      msgContext.setSOAPMessage(reqMessage);

      CommonBindingProvider bindingProvider = new CommonBindingProvider(CommonSOAPBinding.SOAP12HTTP_BINDING, Type.JAXRPC);
View Full Code Here

      Element srcEnv = DOMUtils.parse(srcXML);
      ByteArrayInputStream bais = getFastInputStream(srcXML);

      MessageFactoryImpl factory = new MessageFactoryImpl();
      factory.addFeature(new FastInfosetFeature());
      SOAPMessage soapMessage = factory.createMessage(null, bais);
      SOAPEnvelope resEnv = soapMessage.getSOAPPart().getEnvelope();
      assertEquals(srcEnv, resEnv);
   }

   private ByteArrayInputStream getFastInputStream(String srcXML) throws IOException
View Full Code Here

         "</env:Envelope>";

      ByteArrayInputStream inputStream = new ByteArrayInputStream(envStr.getBytes());

      MessageFactory factory = new MessageFactoryImpl();
      SOAPMessage soapMsg = factory.createMessage(null, inputStream);
      SOAPEnvelope env = soapMsg.getSOAPPart().getEnvelope();

      assertEquals("env:Envelope", env.getNodeName());
      assertEquals(Constants.NS_SOAP11_ENV, env.getNamespaceURI());
     
View Full Code Here

   // [JBWS-745] SAAJ:SOAPBodyElement.addNamespaceDeclaration should allow empty prefix
   public void testAddNamespaceDeclaration() throws Exception
   {
      MessageFactory factory = new MessageFactoryImpl();
      SOAPMessage soapMsg = factory.createMessage();
      SOAPEnvelope env = soapMsg.getSOAPPart().getEnvelope();

      assertEquals("env:Envelope", env.getNodeName());
      assertEquals(Constants.NS_SOAP11_ENV, env.getNamespaceURI());
     
View Full Code Here

      assertTrue("File exists: " + envFile, envFile.exists());

      FileInputStream inputStream = new FileInputStream(envFile);

      MessageFactory factory = new MessageFactoryImpl();
      SOAPMessage soapMsg = factory.createMessage(null, inputStream);
      SOAPEnvelope env = soapMsg.getSOAPPart().getEnvelope();

      assertEquals("SOAP-ENV:Envelope", env.getNodeName());
      assertEquals(Constants.NS_SOAP11_ENV, env.getNamespaceURI());
   }
View Full Code Here

         "</soapenv:Envelope>";
     
      MessageFactory factory = new MessageFactoryImpl();
      ByteArrayInputStream inputStream = new ByteArrayInputStream(expMsg.getBytes());
      StreamSource source = new StreamSource(inputStream);
      SOAPMessage message = factory.createMessage();
      message.getSOAPPart().setContent(source);
      message.saveChanges();
     
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      message.writeTo(baos);
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.