servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r391637 - in /incubator/servicemix/trunk/servicemix-components/src: main/java/org/apache/servicemix/components/wsif/ test/java/org/apache/servicemix/components/wsif/
Date Wed, 05 Apr 2006 15:17:42 GMT
Author: gnodet
Date: Wed Apr  5 08:17:28 2006
New Revision: 391637

URL: http://svn.apache.org/viewcvs?rev=391637&view=rev
Log:
SM-383: WSIF binding fails after the first invocation

Removed:
    incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/wsif/WSIFInBinding.java
Modified:
    incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/wsif/WSIFBinding.java
    incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/wsif/WSIFOperationInfo.java
    incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/wsif/WSIFOperationMap.java
    incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/wsif/WSIFOutBinding.java
    incubator/servicemix/trunk/servicemix-components/src/test/java/org/apache/servicemix/components/wsif/WsifTest.java

Modified: incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/wsif/WSIFBinding.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/wsif/WSIFBinding.java?rev=391637&r1=391636&r2=391637&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/wsif/WSIFBinding.java
(original)
+++ incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/wsif/WSIFBinding.java
Wed Apr  5 08:17:28 2006
@@ -143,7 +143,7 @@
         try {
             WSIFOperationInfo operationInfo = operationMap.getOperationForExchange(exchange);
 
-            WSIFOperation operation = operationInfo.getWsifOperation();
+            WSIFOperation operation = operationInfo.createWsifOperation();
             WSIFMessage inMessage = operation.createInputMessage();
             Object body = getBody(in);
             marshaler.fromNMS(operationInfo, inMessage, in, body);

Modified: incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/wsif/WSIFOperationInfo.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/wsif/WSIFOperationInfo.java?rev=391637&r1=391636&r2=391637&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/wsif/WSIFOperationInfo.java
(original)
+++ incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/wsif/WSIFOperationInfo.java
Wed Apr  5 08:17:28 2006
@@ -15,9 +15,9 @@
  */
 package org.apache.servicemix.components.wsif;
 
-import javax.wsdl.BindingOperation;
-
+import org.apache.wsif.WSIFException;
 import org.apache.wsif.WSIFOperation;
+import org.apache.wsif.WSIFPort;
 
 /**
  * The information about an operation.
@@ -25,19 +25,15 @@
  * @version $Revision$
  */
 public class WSIFOperationInfo {
-    private BindingOperation bindingOperation;
-    private WSIFOperation wsifOperation;
-
-    public WSIFOperationInfo(WSIFOperation wsifOperation, BindingOperation bindingOperation)
{
-        this.wsifOperation = wsifOperation;
-        this.bindingOperation = bindingOperation;
-    }
+    private WSIFPort port;
+    private String name;
 
-    public BindingOperation getBindingOperation() {
-        return bindingOperation;
+    public WSIFOperationInfo(WSIFPort port, String name) {
+        this.port = port;
+        this.name = name;
     }
 
-    public WSIFOperation getWsifOperation() {
-        return wsifOperation;
+    public WSIFOperation createWsifOperation() throws WSIFException {
+        return this.port.createOperation(name);
     }
 }

Modified: incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/wsif/WSIFOperationMap.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/wsif/WSIFOperationMap.java?rev=391637&r1=391636&r2=391637&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/wsif/WSIFOperationMap.java
(original)
+++ incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/wsif/WSIFOperationMap.java
Wed Apr  5 08:17:28 2006
@@ -100,10 +100,7 @@
     protected void addBindingOperation(Binding binding, BindingOperation bindingOperation)
throws WSIFException {
         Operation operation = bindingOperation.getOperation();
         String name = operation.getName();
-        WSIFOperation wsifOperation = service.getPort().createOperation(name);
-
-        WSIFOperationInfo info = new WSIFOperationInfo(wsifOperation, bindingOperation);
-
+        WSIFOperationInfo info = new WSIFOperationInfo(service.getPort(), name);
         operationMap.put(name, info);
         operationMap.put(new QName(name), info);
         if (defaultOperation == null) {

Modified: incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/wsif/WSIFOutBinding.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/wsif/WSIFOutBinding.java?rev=391637&r1=391636&r2=391637&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/wsif/WSIFOutBinding.java
(original)
+++ incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/wsif/WSIFOutBinding.java
Wed Apr  5 08:17:28 2006
@@ -56,7 +56,7 @@
     protected void process(MessageExchange exchange, NormalizedMessage normalizedMessage)
throws MessagingException {
         try {
             WSIFOperationInfo operationInfo = operationMap.getOperationForExchange(exchange);
-            WSIFOperation operation = operationInfo.getWsifOperation();
+            WSIFOperation operation = operationInfo.createWsifOperation();
             WSIFMessage message = operation.createInputMessage();
             marshaler.fromNMS(operationInfo, message, normalizedMessage, getBody(normalizedMessage));
             operation.executeInputOnlyOperation(message);

Modified: incubator/servicemix/trunk/servicemix-components/src/test/java/org/apache/servicemix/components/wsif/WsifTest.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-components/src/test/java/org/apache/servicemix/components/wsif/WsifTest.java?rev=391637&r1=391636&r2=391637&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-components/src/test/java/org/apache/servicemix/components/wsif/WsifTest.java
(original)
+++ incubator/servicemix/trunk/servicemix-components/src/test/java/org/apache/servicemix/components/wsif/WsifTest.java
Wed Apr  5 08:17:28 2006
@@ -30,73 +30,75 @@
 public class WsifTest extends TestSupport {
     QName serviceName = new QName("http://servicemix.org/cheese/", "checkAvailability");
 
+    public static final int MESSAGES = 2;
+    
     public void testUsingXMLMessaging() throws Exception {
-        String file = "request.xml";
-
-        Object answer = requestServiceWithFileRequest(serviceName, file);
-        assertTrue("Shoud return a DOM Node: " + answer, answer instanceof Node);
-        Node node = (Node) answer;
-        System.out.println(transformer.toString(node));
-
-        String text = textValueOfXPath(node, "/*/*[local-name()='part']").trim();
-
-        System.out.println("Found value: " + text);
-
-        assertTrue("price text should not be empty", text.length() > 0);
-
+        for (int i = 0; i < MESSAGES; i++) {
+            String file = "request.xml";
+    
+            Object answer = requestServiceWithFileRequest(serviceName, file);
+            assertTrue("Shoud return a DOM Node: " + answer, answer instanceof Node);
+            Node node = (Node) answer;
+            System.out.println(transformer.toString(node));
+    
+            String text = textValueOfXPath(node, "/*/*[local-name()='part']").trim();
+    
+            System.out.println("Found value: " + text);
+    
+            assertTrue("price text should not be empty", text.length() > 0);
+        }
     }
 
     public void testUsingWSIFStyleJBI() throws Exception {
-
-        // START SNIPPET: wsif
-        InOut exchange = client.createInOutExchange();
-
-        exchange.getInMessage().setProperty("zipCode", "10505");
-        client.sendSync(exchange);
-
-        NormalizedMessage out = exchange.getOutMessage();
-        String result = (String) out.getProperty("result");
-
-        System.out.println("Found value: " + result);
-        // END SNIPPET: wsif
-
-        assertEquals("should have no fault", null, exchange.getFault());
-        Exception error = exchange.getError();
-        if (error != null) {
-            throw error;
+        for (int i = 0; i < MESSAGES; i++) {
+            // START SNIPPET: wsif
+            InOut exchange = client.createInOutExchange();
+    
+            exchange.getInMessage().setProperty("zipCode", "10505");
+            client.sendSync(exchange);
+    
+            NormalizedMessage out = exchange.getOutMessage();
+            String result = (String) out.getProperty("result");
+    
+            System.out.println("Found value: " + result);
+            // END SNIPPET: wsif
+    
+            assertEquals("should have no fault", null, exchange.getFault());
+            Exception error = exchange.getError();
+            if (error != null) {
+                throw error;
+            }
+            assertEquals("should have no error", null, error);
+            assertNotNull("must have an output message!", out);
+    
+            assertTrue("price text should not be empty", result.length() > 0);
         }
-        assertEquals("should have no error", null, error);
-        assertNotNull("must have an output message!", out);
-
-        assertTrue("price text should not be empty", result.length() > 0);
-
     }
 
     public void testUsingWSIFStyleJBIWithEarlyErrorHandling() throws Exception {
-
-        InOut exchange = client.createInOutExchange();
-
-        exchange.getInMessage().setProperty("zipCode", "10505");
-        client.sendSync(exchange);
-
-        Exception error = exchange.getError();
-        if (error != null) {
-            throw error;
+        for (int i = 0; i < MESSAGES; i++) {
+            InOut exchange = client.createInOutExchange();
+    
+            exchange.getInMessage().setProperty("zipCode", "10505");
+            client.sendSync(exchange);
+    
+            Exception error = exchange.getError();
+            if (error != null) {
+                throw error;
+            }
+    
+            assertEquals("should have no fault", null, exchange.getFault());
+            assertEquals("should have no error", null, error);
+    
+            NormalizedMessage out = exchange.getOutMessage();
+            assertNotNull("must have an output message!", out);
+    
+            String result = (String) out.getProperty("result");
+    
+            System.out.println("Found value: " + result);
+    
+            assertTrue("price text should not be empty", result.length() > 0);
         }
-
-        assertEquals("should have no fault", null, exchange.getFault());
-        assertEquals("should have no error", null, error);
-
-        NormalizedMessage out = exchange.getOutMessage();
-        assertNotNull("must have an output message!", out);
-
-        String result = (String) out.getProperty("result");
-
-        System.out.println("Found value: " + result);
-
-
-        assertTrue("price text should not be empty", result.length() > 0);
-
     }
 
     protected AbstractXmlApplicationContext createBeanFactory() {



Mime
View raw message