Package javax.xml.ws.handler.soap

Examples of javax.xml.ws.handler.soap.SOAPMessageContext


   @Override
   protected boolean handleInbound(final MessageContext msgContext)
   {
      try
      {
         SOAPMessageContext smc = (SOAPMessageContext) msgContext;
         SOAPMessage message = smc.getMessage();

         SOAPBody body = message.getSOAPBody();
         Document document = body.extractContentAsDocument();
         NodeList nodes = document.getChildNodes();
         for (int i = 0; i < nodes.getLength(); i++)
View Full Code Here


      {
         log.debug("Enter: handle" + (isOutbound ? "Out" : "In ") + "BoundFault");

         if (msgContext instanceof SOAPMessageContext)
         {
            SOAPMessageContext soapContext = (SOAPMessageContext)msgContext;
            SOAPMessage soapMessage = soapContext.getMessage();

            // If the message is not already a fault message then it is replaced with a fault message
            try
            {
               if (soapMessage == null || soapMessage.getSOAPBody().getFault() == null)
               {
                  soapMessage = SOAPFaultHelperJAXWS.exceptionToFaultMessage(ex);
                  soapContext.setMessage(soapMessage);
               }
            }
            catch (SOAPException se)
            {
               throw new WebServiceException("Cannot convert exception to fault message", ex);
View Full Code Here

/*     */     {
/* 180 */       log.debug("Enter: handle" + (this.isOutbound.booleanValue() ? "Out" : "In ") + "BoundFault");
/*     */
/* 182 */       if ((msgContext instanceof SOAPMessageContext))
/*     */       {
/* 184 */         SOAPMessageContext soapContext = (SOAPMessageContext)msgContext;
/* 185 */         SOAPMessage soapMessage = soapContext.getMessage();
/*     */         try
/*     */         {
/* 190 */           if ((soapMessage == null) || (soapMessage.getSOAPBody().getFault() == null))
/*     */           {
/* 192 */             soapMessage = SOAPFaultHelperJAXWS.exceptionToFaultMessage(ex);
/* 193 */             soapContext.setMessage(soapMessage);
/*     */           }
/*     */         }
/*     */         catch (SOAPException se)
/*     */         {
/* 198 */           throw new WebServiceException("Cannot convert exception to fault message", ex);
View Full Code Here

   private boolean verifyXOPPackage(MessageContext context)
   {
      try
      {
         SOAPMessageContext msgContext = (SOAPMessageContext)context;
         SOAPMessage soapMsg = msgContext.getMessage();
         SOAPEnvelope soapEnv = soapMsg.getSOAPPart().getEnvelope();
         SOAPBody body = soapEnv.getBody();
         boolean found = scanNodes(body.getChildNodes());

         if(found) throw new IllegalStateException("XOP request not properly inlined");
View Full Code Here

      return cookie.toString();
   }

   public boolean handleResponse(MessageContext msgContext)
   {
      SOAPMessageContext smc = (SOAPMessageContext)msgContext;
      SOAPMessage message = smc.getMessage();

      // Legacy JBossWS native approach
      MimeHeaders mimeHeaders = message.getMimeHeaders();
      String[] cookieValues = mimeHeaders.getHeader(CookieUtil.SET_COOKIE);

      // proper approach through MessageContext.HTTP_RESPONSE_HEADERS
      if (cookieValues == null)
      {
         @SuppressWarnings("unchecked")
         Map<String, List<String>> httpHeaders = (Map<String, List<String>>)smc.get(MessageContext.HTTP_RESPONSE_HEADERS);
         List<String> l = httpHeaders.get(CookieUtil.SET_COOKIE);
         if (l != null && !l.isEmpty())
         {
            cookieValues = l.toArray(new String[l.size()]);
         }
View Full Code Here

      {
         log.debug("Enter: handle" + (isOutbound ? "Out" : "In ") + "BoundFault");

         if (msgContext instanceof SOAPMessageContext)
         {
            SOAPMessageContext soapContext = (SOAPMessageContext)msgContext;
            SOAPMessage soapMessage = soapContext.getMessage();

            // If the message is not already a fault message then it is replaced with a fault message
            try
            {
               if (soapMessage == null || soapMessage.getSOAPBody().getFault() == null)
               {
                  soapMessage = SOAPFaultHelperJAXWS.exceptionToFaultMessage(ex);
                  soapContext.setMessage(soapMessage);
               }
            }
            catch (SOAPException se)
            {
               throw new WebServiceException("Cannot convert exception to fault message", ex);
View Full Code Here

    }

    protected void trace(MessageContext msgContext) {
        if (logger.isTraceEnabled()) {
            if (msgContext instanceof SOAPMessageContext) {
                SOAPMessageContext soapMessageContext = (SOAPMessageContext) msgContext;
                logger.trace("WSDL_PORT=" + soapMessageContext.get(SOAPMessageContext.WSDL_PORT));
                logger.trace("WSDL_OPERATION=" + soapMessageContext.get(SOAPMessageContext.WSDL_OPERATION));
                logger.trace("WSDL_INTERFACE=" + soapMessageContext.get(SOAPMessageContext.WSDL_INTERFACE));
                logger.trace("WSDL_SERVICE=" + soapMessageContext.get(SOAPMessageContext.WSDL_SERVICE));
            }
        }
    }
View Full Code Here

            is = cl.getResourceAsStream("/WEB-INF/jboss-wsse.xml");
        return is;
    }

    private QName getOperationName(MessageContext msgContext) {
        SOAPMessageContext soapMessageContext = (SOAPMessageContext) msgContext;
        SOAPMessage soapMessage = soapMessageContext.getMessage();
        SOAPBody soapBody;
        try {
            soapBody = soapMessage.getSOAPBody();
            Node child = soapBody.getFirstChild();
            String childNamespace = child.getNamespaceURI();
View Full Code Here

     */
    protected boolean handleInbound(MessageContext msgContext) {
        logger.trace("Handling Inbound Message");

        String assertionNS = JBossSAMLURIConstants.ASSERTION_NSURI.get();
        SOAPMessageContext ctx = (SOAPMessageContext) msgContext;
        SOAPMessage soapMessage = ctx.getMessage();

        if (soapMessage == null)
            throw logger.nullValueError("SOAP Message");

        // retrieve the assertion
View Full Code Here

     * assertion is then included in the SOAP payload.
     */
    protected boolean handleOutbound(MessageContext msgContext) {
        logger.trace("Handling Outbound Message");

        SOAPMessageContext ctx = (SOAPMessageContext) msgContext;
        SOAPMessage soapMessage = ctx.getMessage();

        // retrieve assertion first from the message context
        Element assertion = (Element) ctx.get(SAML2Constants.SAML2_ASSERTION_PROPERTY);

        // Assertion can also be obtained from the JAAS subject
        if (assertion == null) {
            assertion = getAssertionFromSubject();
        }
View Full Code Here

TOP

Related Classes of javax.xml.ws.handler.soap.SOAPMessageContext

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.