You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ru...@apache.org on 2001/06/13 22:48:51 UTC
cvs commit: xml-axis/java/src/org/apache/axis/utils Options.java
rubys 01/06/13 13:48:50
Modified: java/src/org/apache/axis/handlers JWSProcessor.java
java/src/org/apache/axis/transport/local
LocalDispatchHandler.java
java/src/org/apache/axis/utils Options.java
Log:
Add support for LocalDispatch of jws. Essentially this involves setting
a single property and fixing it so that urls of the file:///name format
are handled properly. Also added a "-f" option as a shorthand for file.
Shortly a unit test will appear, but I wanted to commit this first.
Longer term, we should allow the protocol specified in the URL to influence
the selection of transport...
Revision Changes Path
1.11 +2 -0 xml-axis/java/src/org/apache/axis/handlers/JWSProcessor.java
Index: JWSProcessor.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/JWSProcessor.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- JWSProcessor.java 2001/06/13 15:39:09 1.10
+++ JWSProcessor.java 2001/06/13 20:48:38 1.11
@@ -133,6 +133,8 @@
String outdir = f1.getParent();
String[] args = null ;
+ if (outdir == null) outdir=".";
+
args = new String[] { "-d", outdir,
"-classpath",
System.getProperty("java.class.path" ),
1.4 +16 -0 xml-axis/java/src/org/apache/axis/transport/local/LocalDispatchHandler.java
Index: LocalDispatchHandler.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/transport/local/LocalDispatchHandler.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- LocalDispatchHandler.java 2001/06/12 15:43:20 1.3
+++ LocalDispatchHandler.java 2001/06/13 20:48:43 1.4
@@ -61,6 +61,8 @@
import org.apache.axis.transport.http.*;
import org.apache.axis.utils.*;
+import java.net.*;
+
/**
* This is meant to be used on a SOAP Client to call a SOAP server.
*
@@ -99,6 +101,20 @@
if (action != null) {
serverContext.setProperty(HTTPConstants.MC_HTTP_SOAPACTION, action);
serverContext.setProperty(MessageContext.TRANS_INPUT , "HTTPAction");
+ }
+
+ // set the realpath if possible
+ String transURL = clientContext.getStrProp(MessageContext.TRANS_URL);
+ if (transURL != null) {
+ try {
+ URL url = new URL(transURL);
+ if (url.getProtocol().equals("file")) {
+ String file = url.getFile();
+ if (file.length()>0 && file.charAt(0)=='/') file = file.substring(1);
+ serverContext.setProperty(Constants.MC_REALPATH, file);
+ }
+ } catch (Exception e) {
+ }
}
// invoke the request
1.10 +11 -3 xml-axis/java/src/org/apache/axis/utils/Options.java
Index: Options.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/utils/Options.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- Options.java 2001/05/30 14:18:27 1.9
+++ Options.java 2001/06/13 20:48:48 1.10
@@ -73,7 +73,7 @@
String host ; // -h also -l (url)
String port ; // -p
- String servlet ; // -s
+ String servlet ; // -s also -f (file)
String protocol ;
String user ; // -u
@@ -234,6 +234,13 @@
protocol = url.getProtocol();
}
+ if ( (tmp = isValueSet( 'f' )) != null ) {
+ host = "";
+ port = "-1";
+ servlet = tmp;
+ protocol = "file";
+ }
+
tmp = isValueSet( 'h' ); if ( host == null ) host = tmp ;
tmp = isValueSet( 'p' ); if ( port == null ) port = tmp ;
tmp = isValueSet( 's' ); if ( servlet == null ) servlet = tmp ;
@@ -242,12 +249,13 @@
if ( port == null ) port = "8080" ;
if ( servlet == null ) servlet = "/axis/servlet/AxisServlet" ;
else
- if ( servlet.charAt(0) != '/' ) servlet = "/" + servlet ;
+ if ( servlet.length()>0 && servlet.charAt(0)!='/' )
+ servlet = "/" + servlet ;
if (url == null) {
if (protocol == null) protocol = "http";
tmp = protocol + "://" + host ;
- if ( port != null ) tmp += ":" + port ;
+ if ( port != null && !port.equals("-1")) tmp += ":" + port ;
if ( servlet != null ) tmp += servlet ;
} else tmp = url.toString();
Debug.Print( 3, "getURL returned: " + tmp );