owenb 2003/03/04 08:41:40
Modified: java/src/org/apache/wsif/util WSIFUtils.java
Log:
Change readWSDLThroughAuthProxy to take a java.net.PasswordAuthentication object
as an argument rather than a String for the username and a String for the password
Revision Changes Path
1.32 +7 -4 xml-axis-wsif/java/src/org/apache/wsif/util/WSIFUtils.java
Index: WSIFUtils.java
===================================================================
RCS file: /home/cvs/xml-axis-wsif/java/src/org/apache/wsif/util/WSIFUtils.java,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- WSIFUtils.java 4 Mar 2003 16:25:19 -0000 1.31
+++ WSIFUtils.java 4 Mar 2003 16:41:40 -0000 1.32
@@ -63,6 +63,7 @@
import java.io.Writer;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
+import java.net.PasswordAuthentication;
import java.net.URL;
import java.security.AccessController;
import java.security.PrivilegedAction;
@@ -470,14 +471,14 @@
* specifies the use of the WSIF WSDLFactory implementation which registers
* the extensiblity elements used by the WSIF providers.
* @param wsdlLoc a URI (must be an http or ftp URL) pointing to a WSDL file
- * @param proxyUsername proxy authentication username
- * @param proxyPassword proxy authentication password
+ * @param pa A username and password for the proxy, encapsulated as a
+ * java.net.PasswordAuthentication object
* @return Defintion object representing the definition in the wsdl
* @throws WSDLException Exception thrown if wsdl cannot be read
*/
- public static Definition readWSDLThroughAuthProxy(String wsdlLoc, String
proxyUsername, String proxyPassword)
+ public static Definition readWSDLThroughAuthProxy(String wsdlLoc,
PasswordAuthentication pa)
throws WSDLException {
- Trc.entry(null, wsdlLoc, proxyUsername, "********");
+ Trc.entry(null, wsdlLoc, pa);
initializeProviders();
@@ -487,6 +488,8 @@
wsdlReader.setFeature(Constants.FEATURE_VERBOSE, false);
WSDLLocator lo = null;
try {
+ String proxyUsername = pa.getUserName();
+ String proxyPassword = new String(pa.getPassword());
lo = new AuthenticatingProxyWSDLLocatorImpl(wsdlLoc, proxyUsername,
proxyPassword);
Definition def = wsdlReader.readWSDL(lo);
Trc.exitExpandWsdl(def);