You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by de...@apache.org on 2007/08/01 11:09:54 UTC

svn commit: r561723 - in /webservices/axis2/branches/java/1_3/modules: addressing/src/org/apache/axis2/handlers/addressing/AddressingFinalInHandler.java integration/test/org/apache/axis2/engine/MultipleInvocationTest.java

Author: deepal
Date: Wed Aug  1 02:09:53 2007
New Revision: 561723

URL: http://svn.apache.org/viewvc?view=rev&rev=561723
Log:
fixing 3035
- Hmm , we should not set only the address of the EPR , what we should do is to set the complete To

Added:
    webservices/axis2/branches/java/1_3/modules/integration/test/org/apache/axis2/engine/MultipleInvocationTest.java
Modified:
    webservices/axis2/branches/java/1_3/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingFinalInHandler.java

Modified: webservices/axis2/branches/java/1_3/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingFinalInHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_3/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingFinalInHandler.java?view=diff&rev=561723&r1=561722&r2=561723
==============================================================================
--- webservices/axis2/branches/java/1_3/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingFinalInHandler.java (original)
+++ webservices/axis2/branches/java/1_3/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingFinalInHandler.java Wed Aug  1 02:09:53 2007
@@ -83,19 +83,11 @@
         //on the inbound response side of a synchronous request-response exchange.
         if (!alreadyFoundAddrHeader.contains(WSA_TO) && !messageContext.isServerSide()) {
             Options messageContextOptions = messageContext.getOptions();
-            EndpointReference epr = messageContextOptions.getTo();
-
-            if (epr == null) {
-                epr = new EndpointReference("");
-                messageContextOptions.setTo(epr);
-            }
-
             if (log.isTraceEnabled()) {
                 log.trace(messageContext.getLogIDString() +
                         " setDefaults: Setting WS-Addressing default value for the To property.");
             }
-
-            epr.setAddress(Final.WSA_ANONYMOUS_URL);
+            messageContextOptions.setTo(new EndpointReference(Final.WSA_ANONYMOUS_URL));
         }
 
         if (!alreadyFoundAddrHeader.contains(WSA_REPLY_TO)) {

Added: webservices/axis2/branches/java/1_3/modules/integration/test/org/apache/axis2/engine/MultipleInvocationTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_3/modules/integration/test/org/apache/axis2/engine/MultipleInvocationTest.java?view=auto&rev=561723
==============================================================================
--- webservices/axis2/branches/java/1_3/modules/integration/test/org/apache/axis2/engine/MultipleInvocationTest.java (added)
+++ webservices/axis2/branches/java/1_3/modules/integration/test/org/apache/axis2/engine/MultipleInvocationTest.java Wed Aug  1 02:09:53 2007
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axis2.engine;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.soap.SOAP12Constants;
+import org.apache.axis2.Constants;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.ServiceContext;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.engine.util.TestConstants;
+import org.apache.axis2.integration.TestingUtils;
+import org.apache.axis2.integration.UtilServer;
+import org.apache.axis2.integration.UtilServerBasedTestCase;
+import org.apache.axis2.util.Utils;
+
+public class MultipleInvocationTest extends UtilServerBasedTestCase implements TestConstants {
+    protected AxisConfiguration engineRegistry;
+    protected MessageContext mc;
+    protected ServiceContext serviceContext;
+    protected AxisService service;
+
+    protected boolean finish = false;
+
+    public MultipleInvocationTest() {
+        super(MultipleInvocationTest.class.getName());
+    }
+
+    public MultipleInvocationTest(String testName) {
+        super(testName);
+    }
+
+    public static Test suite() {
+        return getTestSetup(new TestSuite(MultipleInvocationTest.class));
+    }
+
+    protected void setUp() throws Exception {
+        service =
+                Utils.createSimpleService(serviceName,
+                        Echo.class.getName(),
+                        operationName);
+        UtilServer.deployService(service);
+    }
+
+    protected void tearDown() throws Exception {
+        UtilServer.unDeployService(serviceName);
+        UtilServer.unDeployClientService();
+    }
+
+    public void testMutipleInvocation() throws Exception {
+
+        OMElement payload = TestingUtils.createDummyOMElement();
+        Options options = new Options();
+        options.setAction("urn:echoOM");
+        options.setTo(targetEPR);
+        options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
+        options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
+
+        ConfigurationContext configContext =
+                ConfigurationContextFactory.createConfigurationContextFromFileSystem(
+                        TestingUtils.prefixBaseDirectory(Constants.TESTING_REPOSITORY), null);
+        ServiceClient sender = new ServiceClient(configContext, null);
+        sender.engageModule("addressing");
+        sender.setOptions(options);
+        OMElement result = sender.sendReceive(payload);
+        TestingUtils.compareWithCreatedOMElement(result);
+        result = sender.sendReceive(payload);
+        TestingUtils.compareWithCreatedOMElement(result);
+        result = sender.sendReceive(payload);
+        TestingUtils.compareWithCreatedOMElement(result);
+        result = sender.sendReceive(payload);
+        TestingUtils.compareWithCreatedOMElement(result);
+    }
+
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org