Send back error code and Initialise jaxrpcmapping path
authorfcarrion <fcarrion@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 11 Apr 2007 21:51:57 +0000 (21:51 +0000)
committerfcarrion <fcarrion@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 11 Apr 2007 21:51:57 +0000 (21:51 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@527693 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/core/NamingContextListener.java
java/org/apache/naming/factory/webservices/ServiceRefFactory.java

index e81930b..f75eded 100644 (file)
@@ -899,6 +899,40 @@ public class NamingContextListener
                 service.setWsdlfile(wsdlURL.toString());
         }
 
+        if (service.getJaxrpcmappingfile() != null) {
+            URL jaxrpcURL = null;
+
+            try {
+                jaxrpcURL = new URL(service.getJaxrpcmappingfile());
+            } catch (MalformedURLException e) {
+                jaxrpcURL = null;
+            }
+            if (jaxrpcURL == null) {
+                try {
+                    jaxrpcURL = ((Context) container).
+                                                    getServletContext().
+                                                    getResource(service.getJaxrpcmappingfile());
+                } catch (MalformedURLException e) {
+                    jaxrpcURL = null;
+                }
+            }
+            if (jaxrpcURL == null) {
+                try {
+                    jaxrpcURL = ((Context) container).
+                                                    getServletContext().
+                                                    getResource("/" + service.getJaxrpcmappingfile());
+                    logger.debug("  Changing service ref jaxrpc file for /" 
+                                + service.getJaxrpcmappingfile());
+                } catch (MalformedURLException e) {
+                    logger.error(sm.getString("naming.wsdlFailed", e));
+                }
+            }
+            if (jaxrpcURL == null)
+                service.setJaxrpcmappingfile(null);
+            else
+                service.setJaxrpcmappingfile(jaxrpcURL.toString());
+        }
+
         // Create a reference to the resource.
         Reference ref = new ServiceRef
             (service.getName(), service.getType(), service.getServiceqname(),
index ab839e0..0a1af79 100644 (file)
@@ -209,7 +209,10 @@ public class ServiceRefFactory
                         portComponentRef.put(endpoint, new QName(port.getName()));
                     }
                 } catch (Throwable t) {
-                    // Wsdl File not available
+                    NamingException ex = new NamingException
+                    ("Error while reading Wsdl File");
+                    ex.initCause(t);
+                    throw ex;
                 }
             }