Package org.jboss.ws.core.soap

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


      if(log.isDebugEnabled()) log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" + xmlType + "]");
      try
      {
         // TODO: Better way for DOM to source conversion
         Element domElement = DOMUtils.parse(xmlFragment);
         SOAPElement soapElement = new SOAPFactoryImpl().createElement(domElement);
         return soapElement;
      }
      catch (RuntimeException rte)
      {
         throw rte;
View Full Code Here


         XMLFragment xmlFragment = new XMLFragment(result);
         String xmlStr = xmlFragment.toXMLString();
         log.debug("Fault detail: " + xmlStr);

         Element domElement = xmlFragment.toElement();
         SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
         return soapFactory.createElement(domElement);
      }
      catch (BindingException e)
      {
         throw new WebServiceException(e);
      }
View Full Code Here

      return new MessageFactoryImpl();
   }

   public SOAPFactory getSOAPFactory()
   {
      return new SOAPFactoryImpl();
   }
View Full Code Here

         XMLFragment xmlFragment = new XMLFragment(result);
         String xmlStr = xmlFragment.toXMLString();
         log.debug("Fault detail: " + xmlStr);

         Element domElement = xmlFragment.toElement();
         SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
         return soapFactory.createElement(domElement);
      }
      catch (BindingException e)
      {
         throw new WebServiceException(e);
      }
View Full Code Here

  public void writeHeaders(SOAPMessage message) throws AddressingException
  {
    try
    {
      SOAPFactoryImpl factory = (SOAPFactoryImpl)SOAPFactory.newInstance();
      SOAPHeader soapHeader = message.getSOAPHeader();         
     
      // Add the xmlns:wsa declaration
      soapHeader.addNamespaceDeclaration(ADDR.getNamespacePrefix(), ADDR.getNamespaceURI());
           
      // Write wsa:To
      if (getTo() != null)
      {
        SOAPElement element = soapHeader.addChildElement(new NameImpl(ADDR.getToQName()));
        element.addTextNode(getTo().getURI().toString());
      }

      // Write wsa:From
      if (getFrom() != null)
      {
        EndpointReferenceImpl epr = (EndpointReferenceImpl)getFrom();
        epr.setRootQName(ADDR.getFromQName());
        SOAPElement soapElement = factory.createElement(epr.toElement());
        soapElement.removeNamespaceDeclaration(ADDR.getNamespacePrefix());
        soapHeader.addChildElement(soapElement);
      }

      // Write wsa:ReplyTo
      if (getReplyTo() != null)
      {
        EndpointReferenceImpl epr = (EndpointReferenceImpl)getReplyTo();
        epr.setRootQName(ADDR.getReplyToQName());
        SOAPElement soapElement = factory.createElement(epr.toElement());
        soapElement.removeNamespaceDeclaration(ADDR.getNamespacePrefix());
        soapHeader.addChildElement(soapElement);
      }

      // Write wsa:FaultTo
      if (getFaultTo() != null)
      {
        EndpointReferenceImpl epr = (EndpointReferenceImpl)getFaultTo();
        epr.setRootQName(ADDR.getFaultToQName());
        SOAPElement soapElement = factory.createElement(epr.toElement());
        soapElement.removeNamespaceDeclaration(ADDR.getNamespacePrefix());
        soapHeader.addChildElement(soapElement);
      }

      appendRequiredHeader(soapHeader, ADDR.getActionQName(), getAction());
View Full Code Here

   private SOAPElement appendElement(SOAPElement soapElement, Object obj)
   {
      SOAPElement child = null;
      try
      {
         SOAPFactoryImpl factory = (SOAPFactoryImpl)SOAPFactory.newInstance();
         if (obj instanceof Element)
         {
            child = factory.createElement((Element)obj);
            soapElement.addChildElement(child);
         }
         else if (obj instanceof String)
         {
            Element el = DOMUtils.parse((String)obj);
            child = factory.createElement(el);
            soapElement.addChildElement(child);
         }
         else
         {
            throw new AddressingException("Unsupported element: " + obj.getClass().getName());
View Full Code Here

   private Object deserialize(QName xmlName, QName xmlType, Element xmlFragment, SerializationContext serContext) throws BindingException
   {
      if(log.isDebugEnabled()) log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" + xmlType + "]");
      try
      {
         return new SOAPFactoryImpl().createElement(xmlFragment);
      }
      catch (SOAPException se)
      {
         throw new BindingException(se);
      }
View Full Code Here

  public void writeHeaders(SOAPMessage message) throws AddressingException
  {
    try
    {
      SOAPFactoryImpl factory = (SOAPFactoryImpl)SOAPFactory.newInstance();
      SOAPHeader soapHeader = message.getSOAPHeader();         
     
      // Add the xmlns:wsa declaration
      soapHeader.addNamespaceDeclaration(ADDR.getNamespacePrefix(), ADDR.getNamespaceURI());
           
      // Write wsa:To
      if (getTo() != null)
      {
        SOAPElement element = soapHeader.addChildElement(new NameImpl(ADDR.getToQName()));
        element.addTextNode(getTo().getURI().toString());
      }

      // Write wsa:From
      if (getFrom() != null)
      {
        EndpointReferenceImpl epr = (EndpointReferenceImpl)getFrom();
        epr.setRootQName(ADDR.getFromQName());
        SOAPElement soapElement = factory.createElement(epr.toElement());
        soapElement.removeNamespaceDeclaration(ADDR.getNamespacePrefix());
        soapHeader.addChildElement(soapElement);
      }

      // Write wsa:ReplyTo
      if (getReplyTo() != null)
      {
        EndpointReferenceImpl epr = (EndpointReferenceImpl)getReplyTo();
        epr.setRootQName(ADDR.getReplyToQName());
        SOAPElement soapElement = factory.createElement(epr.toElement());
        soapElement.removeNamespaceDeclaration(ADDR.getNamespacePrefix());
        soapHeader.addChildElement(soapElement);
      }

      // Write wsa:FaultTo
      if (getFaultTo() != null)
      {
        EndpointReferenceImpl epr = (EndpointReferenceImpl)getFaultTo();
        epr.setRootQName(ADDR.getFaultToQName());
        SOAPElement soapElement = factory.createElement(epr.toElement());
        soapElement.removeNamespaceDeclaration(ADDR.getNamespacePrefix());
        soapHeader.addChildElement(soapElement);
      }

      appendRequiredHeader(soapHeader, ADDR.getActionQName(), getAction());
View Full Code Here

   private SOAPElement appendElement(SOAPElement soapElement, Object obj)
   {
      SOAPElement child = null;
      try
      {
         SOAPFactoryImpl factory = (SOAPFactoryImpl)SOAPFactory.newInstance();
         if (obj instanceof Element)
         {
            child = factory.createElement((Element)obj);
            soapElement.addChildElement(child);
         }
         else if (obj instanceof String)
         {
            Element el = DOMUtils.parse((String)obj);
            child = factory.createElement(el);
            soapElement.addChildElement(child);
         }
         else
         {
            throw new AddressingException("Unsupported element: " + obj.getClass().getName());
View Full Code Here

      return new MessageFactoryImpl();
   }

   public SOAPFactory getSOAPFactory()
   {
      return new SOAPFactoryImpl();
   }
View Full Code Here

TOP

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

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.