servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r671867 - in /servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src: main/java/org/apache/servicemix/http/endpoints/HttpProviderEndpoint.java test/java/org/apache/servicemix/http/ProviderEndpointTest.java
Date Thu, 26 Jun 2008 12:10:54 GMT
Author: gnodet
Date: Thu Jun 26 05:10:54 2008
New Revision: 671867

URL: http://svn.apache.org/viewvc?rev=671867&view=rev
Log:
SM-1426: HTTP Provider does not return any JBI response (out/fault/error message) when get
a 'Connection refused:' from remote http endpoint

Modified:
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/endpoints/HttpProviderEndpoint.java
    servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/test/java/org/apache/servicemix/http/ProviderEndpointTest.java

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/endpoints/HttpProviderEndpoint.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/endpoints/HttpProviderEndpoint.java?rev=671867&r1=671866&r2=671867&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/endpoints/HttpProviderEndpoint.java
(original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/endpoints/HttpProviderEndpoint.java
Thu Jun 26 05:10:54 2008
@@ -147,6 +147,9 @@
         protected void onResponseComplete() throws IOException {
             handle(this, jbiExchange);
         }
+        protected void onException(Throwable throwable) {
+            throw new RuntimeException(throwable);
+        }
     }
 
 }

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/test/java/org/apache/servicemix/http/ProviderEndpointTest.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/test/java/org/apache/servicemix/http/ProviderEndpointTest.java?rev=671867&r1=671866&r2=671867&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/test/java/org/apache/servicemix/http/ProviderEndpointTest.java
(original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/test/java/org/apache/servicemix/http/ProviderEndpointTest.java
Thu Jun 26 05:10:54 2008
@@ -17,6 +17,7 @@
 package org.apache.servicemix.http;
 
 import javax.jbi.messaging.InOut;
+import javax.jbi.messaging.ExchangeStatus;
 import javax.xml.namespace.QName;
 
 import junit.framework.TestCase;
@@ -137,4 +138,37 @@
                              +  "</jbi:message>"));
         client.sendSync(me);
     }
+
+    public void testSendProblem() throws Exception {
+        HttpComponent http = new HttpComponent();
+
+        HttpSoapProviderEndpoint ep1 = new HttpSoapProviderEndpoint();
+        ep1.setService(new QName("http://servicemix.apache.org/samples/wsdl-first", "PersonService"));
+        ep1.setEndpoint("soap");
+        ep1.setWsdl(new ClassPathResource("person.wsdl"));
+        ep1.setValidateWsdl(false); // TODO: Soap 1.2 not handled yet
+        ep1.setUseJbiWrapper(true);
+
+        http.addEndpoint(ep1);
+        container.activateComponent(http, "http");
+
+        container.start();
+
+        ServiceMixClient client = new DefaultServiceMixClient(container);
+        InOut me = client.createInOutExchange();
+        me.setService(new QName("http://servicemix.apache.org/samples/wsdl-first", "PersonService"));
+        me.setOperation(new QName("http://servicemix.apache.org/samples/wsdl-first", "GetPerson"));
+        me.getInMessage().setContent(new StringSource(
+                                "<jbi:message xmlns:jbi=\"http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper\""
+                             +  "             xmlns:msg=\"http://servicemix.apache.org/samples/wsdl-first/types\"
"
+                             +  "             name=\"Hello\" "
+                             +  "             type=\"msg:HelloRequest\" "
+                             +  "             version=\"1.0\">"
+                             +  "  <jbi:part>"
+                             +  "    <msg:GetPerson><msg:personId>id</msg:personId></msg:GetPerson>"
+                             +  "  </jbi:part>"
+                             +  "</jbi:message>"));
+        client.sendSync(me);
+        assertEquals(ExchangeStatus.ERROR, me.getStatus());
+    }
 }



Mime
View raw message