Package org.jboss.ws.core.soap

Examples of org.jboss.ws.core.soap.MessageFactoryImpl


         "   <argument>responseBean</argument>" +
         "  </HelloResponse>" +
         " </soapenv:Body>" +
         "</soapenv:Envelope>";
     
      MessageFactory factory = new MessageFactoryImpl();
     
      ByteArrayInputStream inputStream = new ByteArrayInputStream(expMsg.getBytes());
      SOAPMessage soapMsg = factory.createMessage(null, inputStream);
           
      SOAPMessage message = factory.createMessage();
      message.getSOAPPart().setContent(soapMsg.getSOAPPart().getContent());
      message.saveChanges();
     
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      message.writeTo(baos);
View Full Code Here


      doPreserveCommentsPerStyle(expMsg, null);
   }

   private void doPreserveCommentsPerStyle(String expXML, Style style) throws IOException, SOAPException
   {
      MessageFactoryImpl factory = new MessageFactoryImpl();
      factory.setStyle(style);
     
      ByteArrayInputStream inputStream = new ByteArrayInputStream(expXML.getBytes());
      SOAPMessage soapMsg = factory.createMessage(null, inputStream);
      SOAPEnvelope wasEnv = soapMsg.getSOAPPart().getEnvelope();
     
      String wasXML = DOMWriter.printNode(wasEnv, false);
      String wasBody = wasXML.substring(wasXML.indexOf("<env:Body>"));
      wasBody = wasBody.substring(0, wasBody.indexOf("</env:Body>") + 11);
View Full Code Here

         "  </soap:Body>" +
         "</soap:Envelope>";

      InputStream inputStream = new FileInputStream("resources/jaxrpc/wsse/interop/microsoft-wse.xml");

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

      // The Microsoft WSE message is timestamp protected like so:
      // <wsu:Timestamp wsu:Id="Timestamp-9e3e6632-f2a1-4b26-a682-9301a75003a7">
      //   <wsu:Created>2005-09-26T22:17:32Z</wsu:Created>
View Full Code Here

   /** Test that we can build an envelope from InputStream */
   public void testSunSTRRequest() throws Exception
   {
      InputStream inputStream = new FileInputStream("resources/jaxrpc/wsse/interop/sun-xws.xml");

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

      // The Sun JWSDP message is timestamp protected like so:
      // <wsu:Timestamp wsu:Id="Timestamp-9e3e6632-f2a1-4b26-a682-9301a75003a7">
View Full Code Here

   /** Test that we can build an envelope from InputStream */
   public void testSunIssuerSerialSignEncrypt() throws Exception
   {
      InputStream inputStream = new FileInputStream("resources/jaxrpc/wsse/interop/sun-xws-issuerserial-sign-encrypt.xml");

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

      // The Sun JWSDP message is timestamp protected like so:
      // <wsu:Timestamp wsu:Id="Timestamp-9e3e6632-f2a1-4b26-a682-9301a75003a7">
View Full Code Here

            + "  <tns:echoString xmlns:tns='http://org.jboss.ws/2004'>" + "   <string>Hello World!</string>" + "  </tns:echoString>" + " </env:Body>"
            + "</env:Envelope>";

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

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

      String inputString = DOMWriter.printNode(soapMsg.getSOAPPart(), true);

      SecurityEncoder encoder = new SecurityEncoder(buildOperations(), new SecurityStore());
      encoder.encode(doc);

      log.debug("Encoded message:" + DOMWriter.printNode(doc, true));

      ByteArrayOutputStream stream = new ByteArrayOutputStream();
      soapMsg.writeTo(stream);

      ByteArrayInputStream instream = new ByteArrayInputStream(stream.toByteArray());
      soapMsg = factory.createMessage(null, instream);
      env = soapMsg.getSOAPPart().getEnvelope();
      doc = env.getOwnerDocument();


      SecurityDecoder decoder = new SecurityDecoder(new SecurityStore(), null);
View Full Code Here

   RequestHandlerImpl()
   {
      SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
      serverConfig = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
      msgFactory = new MessageFactoryImpl();
   }
View Full Code Here

      return soapMessage;
   }

   private static SOAPMessageImpl createSOAPMessage() throws SOAPException
   {
      MessageFactoryImpl factory = (MessageFactoryImpl)MessageFactory.newInstance();

      if (isSOAP12() == true)
      {
         factory.setEnvNamespace(Constants.NS_SOAP12_ENV);
      }

      return (SOAPMessageImpl)factory.createMessage();
   }
View Full Code Here

  
   private SOAPMessage getMessage(Calendar created, String envStr) throws Exception
   {
      envStr = envStr.replaceAll("CREATED", SimpleTypeBindings.marshalDateTime(created));
      ByteArrayInputStream inputStream = new ByteArrayInputStream(envStr.getBytes());
      MessageFactory factory = new MessageFactoryImpl();
      return factory.createMessage(null, inputStream);
   }
View Full Code Here

  
   public void testEncodeMessageWithNonceAndCreated() throws Exception
   {
      WSSecurityConfiguration configuration = WSSecurityOMFactory.newInstance().parse(new StringReader(clientConf));
      ByteArrayInputStream inputStream = new ByteArrayInputStream(testMessage.getBytes());
      MessageFactory factory = new MessageFactoryImpl();
      SOAPMessage soapMsg = factory.createMessage(null, inputStream);
      sec.encodeMessage(configuration, soapMsg, null, "kermit", "therealfrog");
      Element securityEl = (Element)soapMsg.getSOAPHeader().getChildElements(Constants.WSSE_HEADER_QNAME).next();
      Element usernameTokenEl = (Element)DOMUtils.getChildElements(securityEl, new QName(Constants.WSSE_NS, "UsernameToken")).next();
      assertPassword(usernameTokenEl);
      Element nonceEl = (Element)DOMUtils.getChildElements(usernameTokenEl, new QName(Constants.WSSE_NS, "Nonce")).next();
View Full Code Here

TOP

Related Classes of org.jboss.ws.core.soap.MessageFactoryImpl

Copyright © 2018 www.massapicom. 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.