There are two cases when you may need to make manual changes to the web service stub:
When the WSDL document is protected using basic HTTP authentication that requires a username and password, the stub generated automatically by JDeveloper will not allow you to access the web service.
To create a stub to the web service, access the WSDL document in a web browser where you can enter the appropriate authentication. Save the WSDL document to a local location, and create the stub from the copy of the WSDL document.
When the proxy server for your organization requires authentication to access sites outside the firewall, the stub will fail unless the correct HTTP authentication code is present. There are two ways to ensure this and they are described below.
The first is, when you generate the stub, make sure that you select the Generate Basic HTTP Authentication option in the Web Service Stub/Skeleton wizard. In the stub find the following block of code:
Properties props = new Properties();
props.put(OracleSOAPHTTPConnection.AUTH_TYPE, "basic");
props.put(OracleSOAPHTTPConnection.USERNAME, "your_username");
props.put(OracleSOAPHTTPConnection.PASSWORD, "your_password");
m_httpConnection.setProperties(props);
and replace it with the following:
Properties props = new Properties();
props.put(OracleSOAPHTTPConnection.PROXY_AUTH_TYPE, "basic");
props.put(OracleSOAPHTTPConnection.PROXY_HOST, "www-your-proxy");
props.put(OracleSOAPHTTPConnection.PROXY_PORT, "80");
props.put(OracleSOAPHTTPConnection.PROXY_USERNAME, "your_username");
props.put(OracleSOAPHTTPConnection.PROXY_PASSWORD, "your_password");
m_httpConnection.setProperties(props);
This has the same effect as the previous solution. Open the file
<jdev_install>\jdev\bin\jdev.conf
, and add the following
entries:
AddVMOption -Dhttp.proxyAuthType=<http authentication
mechanism e.g. basic or digest>
AddVMOption
-Dhttp.proxyUsername=<username>
AddVMOption
-Dhttp.proxyPassword=<password>
with each value after the = sign (no space) being the required value for the authentication. For example, the following entries set up basic HTTP authorization to a proxy server using the authorization of username “scott” and password “tiger”:
AddVMOption -Dhttp.proxyAuthType=basic
AddVMOption
-Dhttp.proxyUsername=scott
AddVMOption -Dhttp.proxyPassword=tiger
Copyright © 1997, 2004, Oracle. All rights reserved.