You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by de...@apache.org on 2007/07/13 14:53:22 UTC
svn commit: r555973 -
/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java
Author: deepal
Date: Fri Jul 13 05:53:21 2007
New Revision: 555973
URL: http://svn.apache.org/viewvc?view=rev&rev=555973
Log:
when creating service client for mtom sample wsdl , it fails due to uri handling
Modified:
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java?view=diff&rev=555973&r1=555972&r2=555973
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java Fri Jul 13 05:53:21 2007
@@ -74,12 +74,10 @@
import javax.wsdl.xml.WSDLWriter;
import javax.xml.namespace.QName;
import javax.xml.parsers.ParserConfigurationException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.PrintWriter;
+import java.io.*;
import java.net.SocketException;
import java.net.URL;
+import java.net.URISyntaxException;
import java.security.PrivilegedAction;
import java.util.*;
@@ -1563,7 +1561,7 @@
Document doc = XMLUtils.newDocument(in);
WSDLReader reader = WSDLFactory.newInstance().newWSDLReader();
reader.setFeature("javax.wsdl.importDocuments", true);
- Definition wsdlDefinition = reader.readWSDL(null, doc);
+ Definition wsdlDefinition = reader.readWSDL(getBaseURI(wsdlURL.toString()), doc);
return createClientSideAxisService(wsdlDefinition, wsdlServiceName, portName, options);
} catch (IOException e) {
log.error(e);
@@ -1577,6 +1575,19 @@
} catch (WSDLException e) {
log.error(e);
throw AxisFault.makeFault(e);
+ }
+ }
+
+ private static String getBaseURI(String currentURI) {
+ try {
+ File file = new File(currentURI);
+ if (file.exists()) {
+ return file.getCanonicalFile().getParentFile().toURI().toString();
+ }
+ String uriFragment = currentURI.substring(0, currentURI.lastIndexOf("/"));
+ return uriFragment + (uriFragment.endsWith("/") ? "" : "/");
+ } catch (IOException e) {
+ return null;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org