I am trying connect to a wsdl url that is protected by HTTP Basic authentication.  In reviewing the api docs for wsif and wsdl4j, I can't find a way to add user name and password information (without writing my own wsdlReader).  Also, I realize I could wget the file and read it locally,  but I would like to be able to import protected documents on the fly.

I have posted the code to the readWSDL method in WSDLUtils below.  What can I do to add a username a and password to the wsdlReader?  Any help is appreciated.

   public static Definition readWSDL(String contextURL, String wsdlLoc)
        throws WSDLException {
        Trc.entry(null, contextURL, wsdlLoc);

        initializeProviders();

        WSDLFactory factory = WSDLFactory.newInstance(
            WSIFConstants.WSIF_WSDLFACTORY);
        WSDLReader wsdlReader = factory.newWSDLReader();
        wsdlReader.setFeature(Constants.FEATURE_VERBOSE, false);
        try {
            Definition def = wsdlReader.readWSDL(contextURL, wsdlLoc);
            Trc.exitExpandWsdl(def);
            return def;
        } catch (WSDLException e) {
            Trc.exception(e);
            MessageLogger.log("WSIF.0002E", wsdlLoc);
            throw e;
        }
    }

Thanks,
Jeff De Pons

WDI
200 Fairway Drive, Unit 184, Vernon Hills, IL 60061
P: 847.970.6827 F: 847.970.6869
www.brunswickwdi.com

Reply via email to