Package org.jboss.ws.core.soap

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


      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
      SerializationContext serContext = (msgContext != null ? msgContext.getSerializationContext() : new SerializationContextJAXRPC());
      NamespaceRegistry nsRegistry = serContext.getNamespaceRegistry();

      SOAPMessageImpl soapMessage = createSOAPMessage();

      SOAPEnvelopeImpl soapEnvelope = (SOAPEnvelopeImpl)soapMessage.getSOAPPart().getEnvelope();
      SOAPBody soapBody = soapEnvelope.getBody();

      QName faultCode = faultEx.getFaultCode();
      if (faultCode.getNamespaceURI().length() > 0)
         faultCode = nsRegistry.registerQName(faultCode);
View Full Code Here


            throw new WSException("MessageContext not available");

         // Associate current message with message context
         MessageFactoryImpl factory = new MessageFactoryImpl();
         factory.setEnvNamespace(Constants.NS_SOAP11_ENV);
         SOAPMessageImpl resMessage = (SOAPMessageImpl)factory.createMessage();
         msgContext.setSOAPMessage(resMessage);

         ParameterMetaData retParameter = opMetaData.getReturnParameter();
         QName xmlName = retParameter.getXmlName();
         SOAPBodyImpl soapBody = (SOAPBodyImpl)resMessage.getSOAPBody();
         SOAPContentElement bodyElement = new SOAPBodyElementDoc(xmlName);
         bodyElement = (SOAPContentElement)soapBody.addChildElement(bodyElement);

         Source payload = (Source)epInv.getReturnValue();
         bodyElement.setXMLFragment(new XMLFragment(payload));
View Full Code Here

      throw new NotImplementedException();
   }

   public MessageAbstraction bindFaultMessage(Exception ex)
   {
      SOAPMessageImpl faultMessage = SOAPFaultHelperJAXWS.exceptionToFaultMessage(ex);
      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
      if (msgContext != null)
      {
         msgContext.setSOAPMessage(faultMessage);
      }
View Full Code Here

         opMetaData = epMetaData.getOperations().get(0);
      }
      else
      {
         SOAPMessageImpl soapMessage = (SOAPMessageImpl)reqMessage;

         opMetaData = soapMessage.getOperationMetaData(epMetaData);
         SOAPHeader soapHeader = soapMessage.getSOAPHeader();

         // Report a MustUnderstand fault
         if (opMetaData == null)
         {
            String faultString;

            SOAPBodyImpl soapBody = (SOAPBodyImpl)soapMessage.getSOAPBody();
            SOAPBodyElement soapBodyElement = soapBody.getBodyElement();
            if (soapBodyElement != null)
            {
               Name soapName = soapBodyElement.getElementName();
               faultString = "Endpoint " + epMetaData.getPortName() + " does not contain operation meta data for: " + soapName;
View Full Code Here

   }

   /** Create the SOAP-1.1 message */
   protected MessageAbstraction createMessage(OperationMetaData opMetaData) throws SOAPException
   {
      SOAPMessageImpl soapMessage = (SOAPMessageImpl)msgFactory.createMessage();
     
      Use encStyle = opMetaData.getEndpointMetaData().getEncodingStyle();
      if (Use.ENCODED.equals(encStyle))
      {
         SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
         soapEnvelope.addNamespaceDeclaration(Constants.PREFIX_SOAP11_ENC, Constants.URI_SOAP11_ENC);
      }
        
      return soapMessage;
   }
View Full Code Here

    * @return content-id URI, cid, to the attachment containing data or null if data should be inlined.
    */
   public String addMtomAttachment(DataHandler data, String elementNamespace, String elementLocalName)
   {
      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
      SOAPMessageImpl soapMessage = (SOAPMessageImpl)msgContext.getSOAPMessage();

      QName xmlName = new QName(elementNamespace, elementLocalName);
      if(log.isDebugEnabled()) log.debug("serialize: [xmlName=" + xmlName + "]");

      String cid = soapMessage.getCidGenerator().generateFromName(xmlName.getLocalPart());
      AttachmentPart xopPart = soapMessage.createAttachmentPart(data);
      xopPart.addMimeHeader(MimeConstants.CONTENT_ID, '<' + cid + '>'); // RFC2392 requirement
      soapMessage.addAttachmentPart(xopPart);

      if(log.isDebugEnabled()) log.debug("Created attachment part " + cid + ", with content-type " + xopPart.getContentType());

      return "cid:" + cid;
   }
View Full Code Here

   }

   public String addSwaRefAttachment(DataHandler dataHandler)
   {
      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
      SOAPMessageImpl soapMessage = (SOAPMessageImpl)msgContext.getSOAPMessage();

      String cid = soapMessage.getCidGenerator().generateFromCount();
      AttachmentPart swaRefPart = soapMessage.createAttachmentPart(dataHandler);
      swaRefPart.addMimeHeader(MimeConstants.CONTENT_ID, '<' + cid + '>'); // RFC2392 requirement
      soapMessage.addAttachmentPart(swaRefPart);

      if(log.isDebugEnabled()) log.debug("Created attachment part " + cid + ", with content-type " + swaRefPart.getContentType());

      return "cid:" + cid;
   }
View Full Code Here

   }

   /** Create the SOAP-1.1 message */
   protected MessageAbstraction createMessage(OperationMetaData opMetaData) throws SOAPException
   {
      SOAPMessageImpl soapMessage = (SOAPMessageImpl)msgFactory.createMessage();
     
      Use encStyle = opMetaData.getEndpointMetaData().getEncodingStyle();
      if (Use.ENCODED.equals(encStyle))
      {
         SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
         soapEnvelope.addNamespaceDeclaration(Constants.PREFIX_SOAP11_ENC, Constants.URI_SOAP11_ENC);
      }
        
      return soapMessage;
   }
View Full Code Here

   {
      boolean isXOP = false;
      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
      if (msgContext != null)
      {
         SOAPMessageImpl soapMessage = (SOAPMessageImpl)msgContext.getSOAPMessage();
         isXOP = (soapMessage != null && soapMessage.isXOPMessage());
      }
      return isXOP;
   }
View Full Code Here

   {
      boolean isSWARef = false;
      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
      if (msgContext != null)
      {
         SOAPMessageImpl soapMessage = (SOAPMessageImpl)msgContext.getSOAPMessage();
         isSWARef = (soapMessage != null && soapMessage.isSWARefMessage());
      }
      return isSWARef;
   }
View Full Code Here

TOP

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

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.