You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by mi...@apache.org on 2009/03/07 02:30:06 UTC

svn commit: r751164 - in /ode/branches/APACHE_ODE_1.X: axis2-war/src/test/java/org/apache/ode/axis2/httpbinding/ axis2/src/main/java/org/apache/ode/axis2/httpbinding/ utils/src/main/java/org/apache/ode/utils/wsdl/

Author: midon
Date: Sat Mar  7 01:30:05 2009
New Revision: 751164

URL: http://svn.apache.org/viewvc?rev=751164&view=rev
Log:
ODE-546: rest operations may have no parts now

Modified:
    ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/httpbinding/HttpBindingTest.java
    ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpExternalService.java
    ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpMethodConverter.java
    ode/branches/APACHE_ODE_1.X/utils/src/main/java/org/apache/ode/utils/wsdl/Messages.java

Modified: ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/httpbinding/HttpBindingTest.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/httpbinding/HttpBindingTest.java?rev=751164&r1=751163&r2=751164&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/httpbinding/HttpBindingTest.java (original)
+++ ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/httpbinding/HttpBindingTest.java Sat Mar  7 01:30:05 2009
@@ -35,20 +35,9 @@
     protected void setUp() throws Exception {
         super.setUp();
         final CountDownLatch latch = new CountDownLatch(1);
-        jettyWrapper = new JettyWrapper(7070);
-        new Thread("HttpBindingJetty") {
-            public void run() {
-                try {
-                    jettyWrapper.start();
-                    latch.countDown();
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-            }
-        }.start();
-        // wait for jetty to be ready
-        latch.await();
-    }
+      jettyWrapper = new JettyWrapper(7070);
+      jettyWrapper.start();
+  }
 
     @AfterMethod
     protected void tearDown() throws Exception {

Modified: ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpExternalService.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpExternalService.java?rev=751164&r1=751163&r2=751164&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpExternalService.java (original)
+++ ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpExternalService.java Sat Mar  7 01:30:05 2009
@@ -153,7 +153,8 @@
 
 
             // configure the client (proxy, security, etc)
-            Element authenticatePart = DOMUtils.findChildByName(odeMex.getRequest().getMessage(), new QName(null, "WWW-Authenticate"));
+            Element message = odeMex.getRequest().getMessage();
+            Element authenticatePart = message == null ? null : DOMUtils.findChildByName(message, new QName(null, "WWW-Authenticate"));
             HttpHelper.configure(client, method.getURI(), authenticatePart, params);
 
             // this callable encapsulates the http method execution and the process of the response

Modified: ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpMethodConverter.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpMethodConverter.java?rev=751164&r1=751163&r2=751164&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpMethodConverter.java (original)
+++ ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpMethodConverter.java Sat Mar  7 01:30:05 2009
@@ -334,6 +334,9 @@
 
 
     protected Map<String, Element> extractPartElements(Message msgDef, Element message) {
+        if (msgDef.getParts().size() != 0 && message == null) {
+            throw new IllegalArgumentException(msgs.msgOdeMessageExpected());
+        }
         Map<String, Element> partValues = new HashMap<String, Element>();
         for (Iterator iterator = msgDef.getParts().values().iterator(); iterator.hasNext();) {
             Part part = (Part) iterator.next();

Modified: ode/branches/APACHE_ODE_1.X/utils/src/main/java/org/apache/ode/utils/wsdl/Messages.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/utils/src/main/java/org/apache/ode/utils/wsdl/Messages.java?rev=751164&r1=751163&r2=751164&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/utils/src/main/java/org/apache/ode/utils/wsdl/Messages.java (original)
+++ ode/branches/APACHE_ODE_1.X/utils/src/main/java/org/apache/ode/utils/wsdl/Messages.java Sat Mar  7 01:30:05 2009
@@ -158,6 +158,10 @@
         return new IllegalArgumentException(s);
     }
 
+    public Throwable msgOdeMessageExpected() {
+        String s = format("Message expected!");
+        return new IllegalArgumentException(s);
+    }
 
     public Throwable msgOdeMessageMissingRequiredPart(String partName) {
         String s = format("Message is missing required part: {0}", partName);