Package javax.xml.ws.addressing.soap

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


/*     */     {
/* 109 */       SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
/* 110 */       if (soapMessage.getSOAPPart().getEnvelope() != null)
/*     */       {
/* 112 */         SOAPAddressingBuilder builder = (SOAPAddressingBuilder)SOAPAddressingBuilder.getAddressingBuilder();
/* 113 */         SOAPAddressingProperties addrProps = (SOAPAddressingProperties)builder.newAddressingProperties();
/* 114 */         addrProps.readHeaders(soapMessage);
/* 115 */         msgContext.put("javax.xml.ws.addressing.context", addrProps);
/* 116 */         msgContext.setScope("javax.xml.ws.addressing.context", MessageContext.Scope.APPLICATION);
/* 117 */         msgContext.put("javax.xml.ws.addressing.context.inbound", addrProps);
/* 118 */         msgContext.setScope("javax.xml.ws.addressing.context.inbound", MessageContext.Scope.APPLICATION);
/*     */       }
View Full Code Here


/*     */
/*     */   public boolean handleRequest(MessageContext msgContext)
/*     */   {
/*  86 */     if (log.isDebugEnabled()) log.debug("handleRequest");
/*     */
/*  88 */     SOAPAddressingProperties addrProps = (SOAPAddressingProperties)ADDR_BUILDER.newAddressingProperties();
/*  89 */     SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
/*  90 */     addrProps.readHeaders(soapMessage);
/*  91 */     msgContext.setProperty("javax.xml.ws.addressing.context.inbound", addrProps);
/*  92 */     return true;
/*     */   }
View Full Code Here

/*     */   private void handleResponseOrFault(MessageContext msgContext, boolean isFault)
/*     */   {
/* 119 */     SOAPAddressingBuilder builder = (SOAPAddressingBuilder)SOAPAddressingBuilder.getAddressingBuilder();
/* 120 */     SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
/*     */
/* 122 */     SOAPAddressingProperties inProps = (SOAPAddressingProperties)msgContext.getProperty("javax.xml.ws.addressing.context.inbound");
/* 123 */     SOAPAddressingProperties outProps = (SOAPAddressingProperties)msgContext.getProperty("javax.xml.ws.addressing.context.outbound");
/*     */
/* 125 */     if (outProps == null)
/*     */     {
/* 128 */       outProps = (SOAPAddressingProperties)builder.newAddressingProperties();
/* 129 */       msgContext.setProperty("javax.xml.ws.addressing.context.outbound", outProps);
/*     */     }
/*     */
/* 132 */     outProps.initializeAsReply(inProps, isFault);
/*     */     try
/*     */     {
/* 138 */       OperationMetaData opMetaData = ((SOAPMessageContextJAXRPC)msgContext).getOperationMetaData();
/*     */
/* 140 */       if ((!isFault) && (!opMetaData.isOneWay()))
/*     */       {
/* 143 */         AddressingOpMetaExt addrExt = (AddressingOpMetaExt)opMetaData.getExtension(ADDR_CONSTANTS.getNamespaceURI());
/* 144 */         if (addrExt != null)
/*     */         {
/* 146 */           outProps.setAction(ADDR_BUILDER.newURI(addrExt.getOutboundAction()));
/*     */         }
/*     */         else
/*     */         {
/* 150 */           log.warn("Unable to resolve replyAction for " + opMetaData.getQName());
/*     */         }
/*     */
/*     */       }
/* 154 */       else if (isFault)
/*     */       {
/* 156 */         outProps.setAction(ADDR_BUILDER.newURI(ADDR_CONSTANTS.getDefaultFaultAction()));
/*     */       }
/*     */
/*     */     }
/*     */     catch (URISyntaxException e)
/*     */     {
/* 162 */       log.error("Error setting response action", e);
/*     */     }
/*     */
/* 165 */     outProps.writeHeaders(soapMessage);
/*     */   }
View Full Code Here

/*     */
/*     */   public boolean handleRequest(MessageContext msgContext)
/*     */   {
/*  78 */     log.debug("handleRequest");
/*     */
/*  80 */     SOAPAddressingProperties addrProps = (SOAPAddressingProperties)msgContext.getProperty("javax.xml.ws.addressing.context");
/*  81 */     if (addrProps != null) {
/*  82 */       msgContext.setProperty("javax.xml.ws.addressing.context.outbound", addrProps);
/*     */     }
/*  84 */     addrProps = (SOAPAddressingProperties)msgContext.getProperty("javax.xml.ws.addressing.context.outbound");
/*  85 */     if (addrProps != null)
/*     */     {
/*  87 */       SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
/*  88 */       addrProps.writeHeaders(soapMessage);
/*     */     }
/*     */     else
/*     */     {
/*  93 */       addrProps = (SOAPAddressingPropertiesImpl)ADDR_BUILDER.newAddressingProperties();
/*  94 */       msgContext.setProperty("javax.xml.ws.addressing.context.outbound", addrProps);
View Full Code Here

/*     */     {
/* 106 */       SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
/* 107 */       if (soapMessage.getSOAPPart().getEnvelope() != null)
/*     */       {
/* 109 */         SOAPAddressingBuilder builder = (SOAPAddressingBuilder)SOAPAddressingBuilder.getAddressingBuilder();
/* 110 */         SOAPAddressingProperties addrProps = (SOAPAddressingProperties)builder.newAddressingProperties();
/* 111 */         addrProps.readHeaders(soapMessage);
/* 112 */         msgContext.setProperty("javax.xml.ws.addressing.context", addrProps);
/* 113 */         msgContext.setProperty("javax.xml.ws.addressing.context.inbound", addrProps);
/*     */       }
/*     */     }
/*     */     catch (SOAPException ex)
View Full Code Here

  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);

    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

  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);
      }
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.