Examples of SOAPMessageImpl


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

   {
      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

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

    * @param isXOPMessage
    */
   private static void setXOPMessage(boolean isXOPMessage)
   {
      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
      SOAPMessageImpl soapMsg = (SOAPMessageImpl)msgContext.getSOAPMessage();
      soapMsg.setXOPMessage(isXOPMessage);
   }
View Full Code Here

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

      if (log.isDebugEnabled())
         log.debug("Created base64 representation for content-type " + contentType);

      // cleanup the attachment part
      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
      SOAPMessageImpl soapMessage = (SOAPMessageImpl)msgContext.getSOAPMessage();

      if (cid.startsWith("cid:"))
         cid = cid.substring(4);
      cid = '<' + cid + '>';

      AttachmentPart removedPart = soapMessage.removeAttachmentByContentId(cid);
      if (null == removedPart)
         throw new WSException("Unable to remove attachment part " + cid);

      if (log.isDebugEnabled())
         log.debug("Removed attachment part " + cid);
View Full Code Here

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

    * Access an XOP attachment part by content id (CID).
    */
   public static AttachmentPart getAttachmentByCID(String cid) throws SOAPException
   {
      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
      SOAPMessageImpl soapMessage = (SOAPMessageImpl)msgContext.getSOAPMessage();

      // RFC2392 requires the 'cid:' part to be stripped from the cid
      if (cid.startsWith("cid:"))
         cid = cid.substring(4);
      cid = '<' + cid + '>';

      AttachmentPart part = soapMessage.getAttachmentByContentId(cid);
      if (part == null)
         throw new WSException("Cannot find attachment part for: " + cid);

      return part;
   }
View Full Code Here

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

         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

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

   {
      log.error("SOAP request exception", reqEx);

      try
      {
         SOAPMessageImpl faultMessage;
         Throwable cause = reqEx.getCause();
         if (reqEx instanceof SOAPFaultException)
         {
            faultMessage = toSOAPMessage((SOAPFaultException)reqEx);
         }
View Full Code Here

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

      }
   }

   private static SOAPMessageImpl toSOAPMessage(SOAPFaultException faultEx) throws SOAPException
   {
      SOAPMessageImpl soapMessage = createSOAPMessage();

      SOAPBody soapBody = soapMessage.getSOAPBody();
      populateSOAPFault(soapBody, faultEx);

      /* detail
       * X. Serialized service specific exception
       * 2. SOAPFaultException.getFault().getDetail() */
 
View Full Code Here

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

         targetFault.setFaultActor(faultActor);
   }

   private static SOAPMessageImpl toSOAPMessage(Exception ex) throws SOAPException
   {
      SOAPMessageImpl soapMessage = createSOAPMessage();

      SOAPBody soapBody = soapMessage.getSOAPBody();

      SOAPFault soapFault = soapBody.addFault(getFallbackFaultCode(), getFallbackFaultString(ex));

      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
      SerializationContext serContext = msgContext.getSerializationContext();
View Full Code Here

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

   private Object invokeInternalSOAP(Object obj) throws Exception
   {
      Object retObj = null;

      SOAPMessageImpl reqMsg = (SOAPMessageImpl)getRequestMessage(obj);
      String targetAddress = epMetaData.getEndpointAddress();

      // R2744 A HTTP request MESSAGE MUST contain a SOAPAction HTTP header field
      // with a quoted value equal to the value of the soapAction attribute of
      // soapbind:operation, if present in the corresponding WSDL description.

      // R2745 A HTTP request MESSAGE MUST contain a SOAPAction HTTP header field
      // with a quoted empty string value, if in the corresponding WSDL description,
      // the soapAction attribute of soapbind:operation is either not present, or
      // present with an empty string as its value.
      String soapAction = null;
      Map<String, Object> reqContext = getRequestContext();
      Boolean useSOAPAction = (Boolean)reqContext.get(BindingProvider.SOAPACTION_USE_PROPERTY);
      if (Boolean.TRUE.equals(useSOAPAction))
      {
         soapAction = (String)reqContext.get(BindingProvider.SOAPACTION_URI_PROPERTY);
         if (soapAction == null)
            throw new IllegalStateException("Cannot obtain: " + BindingProvider.SOAPACTION_URI_PROPERTY);
      }
      MimeHeaders mimeHeaders = reqMsg.getMimeHeaders();
      mimeHeaders.addHeader("SOAPAction", soapAction != null ? soapAction : "");

      // Get the order of pre/post handlerchains
      HandlerType[] handlerType = new HandlerType[] { HandlerType.PRE, HandlerType.ENDPOINT, HandlerType.POST };
      HandlerType[] faultType = new HandlerType[] { HandlerType.PRE, HandlerType.ENDPOINT, HandlerType.POST };
View Full Code Here

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

      String soapMsg = "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>"
            + "<S:Header xmlns:S='http://schemas.xmlsoap.org/soap/envelope/'/>"
            + "<S:Body xmlns:S='http://schemas.xmlsoap.org/soap/envelope/'>"
            + "<ns1:addItemResponse xmlns:ns1='http://org.jboss.ws/addressing/replyto'>"
            + "<result>Mars Bar</result></ns1:addItemResponse></S:Body></env:Envelope>";
      SOAPMessageImpl soapMessage = (SOAPMessageImpl) factory.createMessage();
      StringReader strReader = new java.io.StringReader(soapMsg);
      StreamSource streamSource2 = new StreamSource(strReader);
      soapMessage.getSOAPPart().setContent(streamSource2);

      ByteArrayOutputStream bout = new ByteArrayOutputStream();
      soapMessage.writeTo(bout);
      assertTrue(new String(bout.toByteArray()).indexOf("S:Header") > -1);
      assertTrue(new String(bout.toByteArray()).indexOf("S:Body") > -1);
   }
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.