axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chinth...@apache.org
Subject svn commit: r381062 - in /webservices/axis2/trunk/java/modules: addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java core/src/org/apache/axis2/description/AxisService.java core/src/org/apache/axis2/util/Utils.java
Date Sun, 26 Feb 2006 06:29:07 GMT
Author: chinthaka
Date: Sat Feb 25 22:29:04 2006
New Revision: 381062

URL: http://svn.apache.org/viewcvs?rev=381062&view=rev
Log:
removing sgc specific code from addressing out handler. Now addressing handlers are clean
from sgc information. It was mt mistake that I have kept it in addressing handlers.

Modified:
    webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java

Modified: webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java?rev=381062&r1=381061&r2=381062&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
(original)
+++ webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
Sat Feb 25 22:29:04 2006
@@ -23,6 +23,7 @@
 import org.apache.axis2.addressing.RelatesTo;
 import org.apache.axis2.client.Options;
 import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.ServiceContext;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.ws.commons.om.OMAbstractFactory;
@@ -66,7 +67,8 @@
             // we always defaults to Submission.WSA_NAMESPACE. Hope this is fine.
             addressingNamespace = Final.WSA_NAMESPACE.equals(addressingVersionFromCurrentMsgCtxt)
                     ? Final.WSA_NAMESPACE : Submission.WSA_NAMESPACE;
-        } else if (msgContext.getOperationContext() != null) { // check for a IN message
context, else default to WSA Final
+        } else if (msgContext.getOperationContext() != null)
+        { // check for a IN message context, else default to WSA Final
             MessageContext inMessageContext = msgContext.getOperationContext()
                     .getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
             if (inMessageContext != null) {
@@ -150,7 +152,8 @@
     }
 
     private void processRelatesTo(SOAPEnvelope envelope, Options messageContextOptions) {
-        if (!isAddressingHeaderAlreadyAvailable(WSA_RELATES_TO, envelope, addressingNamespaceObject))
{
+        if (!isAddressingHeaderAlreadyAvailable(WSA_RELATES_TO, envelope, addressingNamespaceObject))
+        {
             RelatesTo relatesTo = messageContextOptions.getRelatesTo();
             OMElement relatesToHeader = null;
 
@@ -192,23 +195,27 @@
 
     private void processReplyTo(SOAPEnvelope envelope, Options messageContextOptions, MessageContext
msgContext) {
         EndpointReference epr;
-        if (!isAddressingHeaderAlreadyAvailable(WSA_REPLY_TO, envelope, addressingNamespaceObject))
{
+        if (!isAddressingHeaderAlreadyAvailable(WSA_REPLY_TO, envelope, addressingNamespaceObject))
+        {
             epr = messageContextOptions.getReplyTo();
             if (epr == null) {//optional
-                if (msgContext.getServiceContext() != null &&
-                        msgContext.getServiceContext().getMyEPR() != null) {
-//                     epr = new EndpointReference(msgContext.getServiceContext().getMyEPRAddress());
-                    epr = msgContext.getServiceContext().getMyEPR();
+                ServiceContext serviceContext = msgContext.getServiceContext();
+                if (serviceContext != null &&
+                        serviceContext.getMyEPR() != null) {
+                    epr = serviceContext.getMyEPR();
                 } else {
                     // setting anonymous URI. Defaulting to Final.
                     epr = new EndpointReference(anonymousURI);
                 }
-            }
-            // add the service group id as a reference parameter
-            String serviceGroupContextId = msgContext.getServiceGroupContextId();
-            if (serviceGroupContextId != null && !"".equals(serviceGroupContextId))
{
-                epr.addReferenceParameter(new QName(Constants.AXIS2_NAMESPACE_URI,
-                        Constants.SERVICE_GROUP_ID, Constants.AXIS2_NAMESPACE_PREFIX), serviceGroupContextId);
+            } else if ("".equals(epr.getAddress())) {
+                ServiceContext serviceContext = msgContext.getServiceContext();
+                if (serviceContext != null &&
+                        serviceContext.getMyEPR() != null) {
+                    epr.setAddress(serviceContext.getMyEPR().getAddress());
+                } else {
+                    // setting anonymous URI. Defaulting to Final.
+                    epr.setAddress(anonymousURI);
+                }
             }
             addToSOAPHeader(epr, AddressingConstants.WSA_REPLY_TO, envelope);
         }
@@ -216,7 +223,8 @@
 
     private void processToEPR(Options messageContextOptions, SOAPEnvelope envelope) {
         EndpointReference epr = messageContextOptions.getTo();
-        if (epr != null && !isAddressingHeaderAlreadyAvailable(WSA_TO, envelope,
addressingNamespaceObject)) {
+        if (epr != null && !isAddressingHeaderAlreadyAvailable(WSA_TO, envelope,
addressingNamespaceObject))
+        {
             String address = epr.getAddress();
             if (!"".equals(address) && address != null) {
                 SOAPHeaderBlock toHeaderBlock = envelope.getHeader().addHeaderBlock(WSA_TO,
addressingNamespaceObject);
@@ -243,7 +251,8 @@
     protected void addToSOAPHeader(EndpointReference epr,
                                    String type,
                                    SOAPEnvelope envelope) {
-        if (epr == null || isAddressingHeaderAlreadyAvailable(type, envelope, addressingNamespaceObject))
{
+        if (epr == null || isAddressingHeaderAlreadyAvailable(type, envelope, addressingNamespaceObject))
+        {
             return;
         }
 

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java?rev=381062&r1=381061&r2=381062&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java
Sat Feb 25 22:29:04 2006
@@ -17,7 +17,11 @@
 
 package org.apache.axis2.description;
 
-import com.ibm.wsdl.extensions.soap.*;
+import com.ibm.wsdl.extensions.soap.SOAPAddressImpl;
+import com.ibm.wsdl.extensions.soap.SOAPBindingImpl;
+import com.ibm.wsdl.extensions.soap.SOAPBodyImpl;
+import com.ibm.wsdl.extensions.soap.SOAPConstants;
+import com.ibm.wsdl.extensions.soap.SOAPOperationImpl;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
 import org.apache.axis2.engine.AxisConfiguration;
@@ -34,12 +38,22 @@
 import org.apache.wsdl.WSDLConstants;
 import org.apache.wsdl.WSDLDescription;
 
-import javax.wsdl.*;
+import javax.wsdl.Binding;
+import javax.wsdl.BindingInput;
+import javax.wsdl.BindingOperation;
+import javax.wsdl.BindingOutput;
+import javax.wsdl.Definition;
+import javax.wsdl.Port;
+import javax.wsdl.Service;
 import javax.wsdl.extensions.soap.SOAPAddress;
 import javax.wsdl.factory.WSDLFactory;
 import javax.xml.namespace.QName;
 import java.io.OutputStream;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
 
 /**
  * Class AxisService
@@ -643,6 +657,13 @@
         return scope;
     }
 
+    /**
+     * @param scope - Available scopes :
+     *              Constants.SCOPE_APPLICATION
+     *              Constants.SCOPE_TRANSPORT_SESSION
+     *              Constants.SCOPE_SOAP_SESSION
+     *              Constants.SCOPE_REQUEST.equals
+     */
     public void setScope(String scope) {
         if (Constants.SCOPE_APPLICATION.equals(scope) ||
                 Constants.SCOPE_TRANSPORT_SESSION.equals(scope) ||

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java?rev=381062&r1=381061&r2=381062&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java Sat Feb
25 22:29:04 2006
@@ -20,6 +20,7 @@
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
 import org.apache.axis2.addressing.AddressingConstants;
+import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.addressing.RelatesTo;
 import org.apache.axis2.client.Options;
 import org.apache.axis2.context.ConfigurationContext;
@@ -75,6 +76,16 @@
 
         newmsgCtx.setMessageID(UUIDGenerator.getUUID());
         newmsgCtx.setTo(oldOptions.getReplyTo());
+
+        // add the service group id as a reference parameter
+        String serviceGroupContextId = inMessageContext.getServiceGroupContextId();
+        if (serviceGroupContextId != null && !"".equals(serviceGroupContextId)) {
+            EndpointReference replyToEPR = new EndpointReference("");
+            replyToEPR.addReferenceParameter(new QName(Constants.AXIS2_NAMESPACE_URI,
+                    Constants.SERVICE_GROUP_ID, Constants.AXIS2_NAMESPACE_PREFIX), serviceGroupContextId);
+            newmsgCtx.setReplyTo(replyToEPR);
+        }
+
         newmsgCtx.setFaultTo(oldOptions.getFaultTo());
         newmsgCtx.setFrom(oldOptions.getTo());
         newmsgCtx.setRelatesTo(



Mime
View raw message