You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by wc...@apache.org on 2001/04/08 16:30:23 UTC
cvs commit: xml-soap/java/samples/xmethods GetTemp.java README
wcloeten 01/04/08 07:30:23
Modified: java/samples/xmethods GetTemp.java README
Log:
added support for HTTP proxy authentication, credits to Jan De Moerloose <ja...@alcatel.be>
Revision Changes Path
1.2 +20 -1 xml-soap/java/samples/xmethods/GetTemp.java
Index: GetTemp.java
===================================================================
RCS file: /home/cvs/xml-soap/java/samples/xmethods/GetTemp.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- GetTemp.java 2001/01/20 01:41:01 1.1
+++ GetTemp.java 2001/04/08 14:30:23 1.2
@@ -80,7 +80,7 @@
public static void main(String[] args) throws Exception {
String serviceURL = null;
- String proxyHost = null;
+ String proxyHost = null, proxyUserName = null, proxyPassword = null;
int proxyPort = -1;
String zipcode = null;
@@ -102,6 +102,19 @@
}
}
}
+ } else if ("-a".equalsIgnoreCase(args[i])) {
+ goodUsage = false;
+ if (args.length > i) {
+ i++;
+ int pos = args[i].indexOf(':');
+ if (pos != -1) {
+ goodUsage = true;
+ proxyUserName = args[i].substring(0, pos);
+ proxyPassword = args[i].substring(pos + 1);
+ } else
+ break;
+ } else
+ break;
} else if ("-u".equalsIgnoreCase(args[i])) {
goodUsage = false;
if (args.length > i && serviceURL == null) {
@@ -123,6 +136,7 @@
System.err.println("Usage: java samples.xmethods.GetTemp " +
"[-u service-URL] " +
"[-p <HTTP proxy hostname:port>] " +
+ "[-a <HTTP proxy username:password>] " +
"zipcode");
System.exit(1);
}
@@ -136,6 +150,11 @@
if (proxyHost != null) {
st.setProxyHost(proxyHost);
st.setProxyPort(proxyPort);
+
+ if (proxyUserName != null) {
+ st.setProxyUserName(proxyUserName);
+ st.setProxyPassword(proxyPassword);
+ }
}
// build the call.
1.2 +2 -1 xml-soap/java/samples/xmethods/README
Index: README
===================================================================
RCS file: /home/cvs/xml-soap/java/samples/xmethods/README,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- README 2001/01/20 01:41:01 1.1
+++ README 2001/04/08 14:30:23 1.2
@@ -10,5 +10,6 @@
Usage: java samples.xmethods.GetTemp
[-u service-URL]
- [-p <HTTP proxy hostname:port>]
+ [-p <HTTP proxy hostname:port>
+ -a <HTTP proxy username:password>]]
zipcode