servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject svn commit: r798795 - /servicemix/components/shared-libraries/trunk/servicemix-soap/src/main/java/org/apache/servicemix/soap/SoapEndpoint.java
Date Wed, 29 Jul 2009 06:58:29 GMT
Author: jbonofre
Date: Wed Jul 29 06:58:29 2009
New Revision: 798795

URL: http://svn.apache.org/viewvc?rev=798795&view=rev
Log:
[#SM-1863] Exceptions for SOAP calls after retrieving WSDL.

Modified:
    servicemix/components/shared-libraries/trunk/servicemix-soap/src/main/java/org/apache/servicemix/soap/SoapEndpoint.java

Modified: servicemix/components/shared-libraries/trunk/servicemix-soap/src/main/java/org/apache/servicemix/soap/SoapEndpoint.java
URL: http://svn.apache.org/viewvc/servicemix/components/shared-libraries/trunk/servicemix-soap/src/main/java/org/apache/servicemix/soap/SoapEndpoint.java?rev=798795&r1=798794&r2=798795&view=diff
==============================================================================
--- servicemix/components/shared-libraries/trunk/servicemix-soap/src/main/java/org/apache/servicemix/soap/SoapEndpoint.java
(original)
+++ servicemix/components/shared-libraries/trunk/servicemix-soap/src/main/java/org/apache/servicemix/soap/SoapEndpoint.java
Wed Jul 29 06:58:29 2009
@@ -16,7 +16,9 @@
  */
 package org.apache.servicemix.soap;
 
+import java.net.MalformedURLException;
 import java.net.URI;
+import java.net.URL;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -24,8 +26,8 @@
 import java.util.Map;
 
 import javax.jbi.component.ComponentContext;
-import javax.jbi.messaging.MessageExchange.Role;
 import javax.jbi.messaging.MessageExchange;
+import javax.jbi.messaging.MessageExchange.Role;
 import javax.jbi.servicedesc.ServiceEndpoint;
 import javax.wsdl.Definition;
 import javax.wsdl.Import;
@@ -43,11 +45,12 @@
 
 import org.apache.servicemix.common.JbiConstants;
 import org.apache.servicemix.common.endpoints.AbstractEndpoint;
-import org.apache.servicemix.common.security.KeystoreManager;
 import org.apache.servicemix.common.security.AuthenticationService;
+import org.apache.servicemix.common.security.KeystoreManager;
 import org.apache.servicemix.common.wsdl1.JbiExtension;
 import org.apache.servicemix.soap.handlers.addressing.AddressingHandler;
 import org.springframework.core.io.Resource;
+import org.springframework.core.io.UrlResource;
 import org.w3c.dom.Document;
 
 import com.ibm.wsdl.Constants;
@@ -221,6 +224,25 @@
             throw new IllegalArgumentException("Unrecognized role: " + role);
         }
     }
+    
+    /**
+     * In addition to setting the description, attempts to set
+     * the wsdlResource to fix a reloading issue.
+     */
+    @Override
+    public void setDescription(Document description) {
+        super.setDescription(description);
+        String uri = description.getBaseURI();
+        if (uri != null) {
+            try {
+                URL url = new URL(uri);
+                logger.debug("Setting wsdlResource: " + url.toExternalForm());
+                this.setWsdlResource(new UrlResource(url));
+            } catch (MalformedURLException e) {
+                logger.warn("Could not parse URL", e);
+            }
+        }
+    }
 
     /**
      * Load the wsdl for this endpoint.



Mime
View raw message