Package javax.xml.ws.addressing.soap

Examples of javax.xml.ws.addressing.soap.SOAPAddressingProperties


  protected boolean handleInbound(MessageContext msgContext)
  {
    if(log.isDebugEnabled()) log.debug("handleInbound");

    SOAPAddressingProperties addrProps = (SOAPAddressingProperties)ADDR_BUILDER.newAddressingProperties();
    SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
    addrProps.readHeaders(soapMessage);
    msgContext.put(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND, addrProps);
    msgContext.setScope(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND, Scope.APPLICATION);
    msgContext.put(MessageContext.REFERENCE_PARAMETERS, convertToElementList(addrProps.getReferenceParameters().getElements()));
    msgContext.setScope(MessageContext.REFERENCE_PARAMETERS, Scope.APPLICATION);
    return true;
  }
View Full Code Here


  private void handleResponseOrFault(MessageContext msgContext, boolean isFault)
  {
    SOAPAddressingBuilder builder = (SOAPAddressingBuilder)SOAPAddressingBuilder.getAddressingBuilder();
    SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();

    SOAPAddressingProperties inProps = (SOAPAddressingProperties)msgContext.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
    SOAPAddressingProperties outProps = (SOAPAddressingProperties)msgContext.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND);

    if (outProps == null)
    {
      // create new response properties
      outProps = (SOAPAddressingProperties)builder.newAddressingProperties();
      msgContext.put(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND, outProps);
      msgContext.setScope(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND, Scope.APPLICATION);
    }

    outProps.initializeAsReply(inProps, isFault);

    try
    {
      // supply the response action

      OperationMetaData opMetaData = ((CommonMessageContext)msgContext).getOperationMetaData();

      if (!isFault && !opMetaData.isOneWay())
      {

        AddressingOpMetaExt addrExt = (AddressingOpMetaExt)opMetaData.getExtension(ADDR_CONSTANTS.getNamespaceURI());
        if (addrExt != null)
        {
          outProps.setAction(ADDR_BUILDER.newURI(addrExt.getOutboundAction()));
        }
        else
        {
          log.warn("Unable to resolve replyAction for " + opMetaData.getQName());
        }

      }
      else if (isFault)
      {
        outProps.setAction(ADDR_BUILDER.newURI(ADDR_CONSTANTS.getDefaultFaultAction()));
      }

    }
    catch (URISyntaxException e)
    {
      log.error("Error setting response action", e);
    }

    outProps.writeHeaders(soapMessage);
  }
View Full Code Here

    */
   public boolean handleRequest(MessageContext msgContext)
   {
      if(log.isDebugEnabled()) log.debug("handleRequest");

      SOAPAddressingProperties addrProps = (SOAPAddressingProperties)ADDR_BUILDER.newAddressingProperties();
      SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
      addrProps.readHeaders(soapMessage);
      msgContext.setProperty(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND, addrProps);
      return true;
   }
View Full Code Here

   private void handleResponseOrFault(MessageContext msgContext, boolean isFault)
   {
      SOAPAddressingBuilder builder = (SOAPAddressingBuilder)SOAPAddressingBuilder.getAddressingBuilder();
      SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();

      SOAPAddressingProperties inProps = (SOAPAddressingProperties)msgContext.getProperty(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
      SOAPAddressingProperties outProps = (SOAPAddressingProperties)msgContext.getProperty(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND);

      if (outProps == null)
      {
         // create new response properties
         outProps = (SOAPAddressingProperties)builder.newAddressingProperties();
         msgContext.setProperty(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND, outProps);
      }

      outProps.initializeAsReply(inProps, isFault);

      try
      {
         // supply the response action

         OperationMetaData opMetaData = ((SOAPMessageContextJAXRPC)msgContext).getOperationMetaData();

         if (!isFault && !opMetaData.isOneWay())
         {

            AddressingOpMetaExt addrExt = (AddressingOpMetaExt)opMetaData.getExtension(ADDR_CONSTANTS.getNamespaceURI());
            if (addrExt != null)
            {
               outProps.setAction(ADDR_BUILDER.newURI(addrExt.getOutboundAction()));
            }
            else
            {
               log.warn("Unable to resolve replyAction for " + opMetaData.getQName());
            }

         }
         else if (isFault)
         {
            outProps.setAction(ADDR_BUILDER.newURI(ADDR_CONSTANTS.getDefaultFaultAction()));
         }

      }
      catch (URISyntaxException e)
      {
         log.error("Error setting response action", e);
      }

      outProps.writeHeaders(soapMessage);
   }
View Full Code Here

   public boolean handleRequest(MessageContext msgContext)
   {
      log.debug("handleRequest");

      SOAPAddressingProperties addrProps = (SOAPAddressingProperties)msgContext.getProperty(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES);
      if (addrProps != null)
         msgContext.setProperty(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addrProps);

      addrProps = (SOAPAddressingProperties)msgContext.getProperty(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
      if (addrProps != null)
      {
         SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
         addrProps.writeHeaders(soapMessage);
      }
      else
      {
         // supply default addressing properties
         addrProps = (SOAPAddressingPropertiesImpl)ADDR_BUILDER.newAddressingProperties();
View Full Code Here

      {
         SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
         if (soapMessage.getSOAPPart().getEnvelope() != null)
         {
            SOAPAddressingBuilder builder = (SOAPAddressingBuilder)SOAPAddressingBuilder.getAddressingBuilder();
            SOAPAddressingProperties addrProps = (SOAPAddressingProperties)builder.newAddressingProperties();
            addrProps.readHeaders(soapMessage);
            msgContext.setProperty(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, addrProps);
            msgContext.setProperty(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_INBOUND, addrProps);
         }
      }
      catch (SOAPException ex)
View Full Code Here

  protected boolean handleOutbound(MessageContext msgContext)
  {
    log.debug("handleOutbound");

      SOAPAddressingProperties addrProps = (SOAPAddressingProperties)msgContext.get(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES);
      if (addrProps != null)
      {
         msgContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addrProps);
         msgContext.setScope(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, Scope.APPLICATION);
      }
     
      addrProps = (SOAPAddressingProperties)msgContext.get(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
      if (addrProps == null)
      {
         // supply default addressing properties
         addrProps = (SOAPAddressingPropertiesImpl)ADDR_BUILDER.newAddressingProperties();
         msgContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addrProps);
         msgContext.setScope(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, Scope.APPLICATION);
      }
     
      if (addrProps.getAction() == null)
      {
         try
         {
            OperationMetaData opMetaData = ((CommonMessageContext)msgContext).getOperationMetaData();
            addrProps.setAction(ADDR_BUILDER.newURI(opMetaData.getJavaName()));
         }
         catch (URISyntaxException ex)
         {
            // ignore
         }
      }
     
    SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
    addrProps.writeHeaders(soapMessage);

    return true;
  }
View Full Code Here

    {
      SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
      if (soapMessage.getSOAPPart().getEnvelope() != null)
      {
        SOAPAddressingBuilder builder = (SOAPAddressingBuilder)SOAPAddressingBuilder.getAddressingBuilder();
        SOAPAddressingProperties addrProps = (SOAPAddressingProperties)builder.newAddressingProperties();
        addrProps.readHeaders(soapMessage);
            msgContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, addrProps);
            msgContext.setScope(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, Scope.APPLICATION);
            msgContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_INBOUND, addrProps);
            msgContext.setScope(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_INBOUND, Scope.APPLICATION);
            msgContext.put(MessageContext.REFERENCE_PARAMETERS, convertToElementList(addrProps.getReferenceParameters().getElements()));
            msgContext.setScope(MessageContext.REFERENCE_PARAMETERS, Scope.APPLICATION);
      }
    }
    catch (SOAPException ex)
    {
View Full Code Here

   public boolean handleRequest(MessageContext msgContext)
   {
      log.debug("handleRequest");

      SOAPAddressingProperties addrProps = (SOAPAddressingProperties)msgContext.getProperty(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES);
      if (addrProps != null)
         msgContext.setProperty(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addrProps);

      addrProps = (SOAPAddressingProperties)msgContext.getProperty(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
      if (addrProps != null)
      {
         SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
         addrProps.writeHeaders(soapMessage);
      }
      else
      {
         // supply default addressing properties
         addrProps = (SOAPAddressingPropertiesImpl)ADDR_BUILDER.newAddressingProperties();
View Full Code Here

      {
         SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
         if (soapMessage.getSOAPPart().getEnvelope() != null)
         {
            SOAPAddressingBuilder builder = (SOAPAddressingBuilder)SOAPAddressingBuilder.getAddressingBuilder();
            SOAPAddressingProperties addrProps = (SOAPAddressingProperties)builder.newAddressingProperties();
            addrProps.readHeaders(soapMessage);
            msgContext.setProperty(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, addrProps);
            msgContext.setProperty(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_INBOUND, addrProps);
         }
      }
      catch (SOAPException ex)
View Full Code Here

TOP

Related Classes of javax.xml.ws.addressing.soap.SOAPAddressingProperties

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.