You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wsif-user@ws.apache.org by jd...@brunswickwdi.com on 2003/10/16 17:13:56 UTC

Importing wsdl protected by HTTP Basic Auth

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