wood burning stoves 2.0*
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes Generated Stub and Proxy  Settings !! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "Generated Stub and Proxy  Settings !!" Watch "Generated Stub and Proxy  Settings !!" New topic
Author

Generated Stub and Proxy Settings !!

Marco Lombardo
Ranch Hand

Joined: Jul 05, 2005
Posts: 71
I use a generated stub to connect to a web service on the internet.
In my intranet there is a proxy to connect in internet.
When i try to connect to the web service i have the following

java.rmi.RemoteException:

HTTP Status-Code 407: Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy filter is denied. ); nested exception is:
HTTP Status-Code 407: Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy filter is denied. )

How can I configure the stub to use the same proxy settings of my
internet connection?

I try with the system property http.proxyHost and http.proxyPort but don't work.


Team Leader<br />SCJP, SCBCD , SCDJWS, Oracle WebLogic, IBM WebSphere e IBM FileNet Certified<br /> <br /><a href="http://www.marcolombardo.it" target="_blank" rel="nofollow">http://www.marcolombardo.it</a>
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
I guess you should probably try to use -Dhttp.nonProxyHosts=<name_of_web_service_host>

http://java.sun.com/j2se/1.5.0/docs/guide/net/properties.html
[ December 06, 2006: Message edited by: Valentin Crettaz ]

SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
Marco Lombardo
Ranch Hand

Joined: Jul 05, 2005
Posts: 71
If I do what do you write me I obtain :
java.rmi.RemoteException: HTTP transport error: java.net.UnknownHostException: www.webservicex.net; nested exception is:

HTTP transport error: java.net.UnknownHostException: www.webservicex.net

at lombamarc.moneyconv.CurrencyConvertorSoap_Stub.conversionRate(CurrencyConvertorSoap_Stub.java:104)

at lombamarc.moneyconv.Main.main(Main.java:40)

This is normally because I must use the proxy settings to connect in internet (where there is a intenet web service). If I don't use the proxy settings i can't access out of my intranet. The problem is :
How can tell to the stub to use the proxy settings in a correct way?
Watsh Rajneesh
Ranch Hand

Joined: Apr 17, 2006
Posts: 110
Hi Marco,

You dont need to tell the Stub rather tell the JVM using the java properties as Val indicated above only i think you must use the following options (keys):
http.proxyHost
http.proxyPort (default: 80 if http.proxyHost specified)

and dont bypass the proxy for the very reason you state that to go to an internet site you must pass through the proxy.

Additionally, if your proxy server requires authentication then also use the following properties: (i think this is what you are missing in your first post error - 407 Proxy server authentication failed).
http.proxyUser
http.proxyPassword

See this Axis doc for client side settings.

Hope this helps.

-Watsh
[ December 07, 2006: Message edited by: Watsh Rajneesh ]

SCJP 5.0 (90%), SCDJWS 1.4 (88%), SCWCD 1.4 (82%), SCBCD 1.3 (85%)
Marco Lombardo
Ranch Hand

Joined: Jul 05, 2005
Posts: 71
I have the following exception:
java.rmi.RemoteException: HTTP Status-Code 407: Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy filter is denied. ); nested exception is:

HTTP Status-Code 407: Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy filter is denied. )

at lombamarc.moneyconv.CurrencyConvertorSoap_Stub.conversionRate(CurrencyConvertorSoap_Stub.java:104)

at lombamarc.moneyconv.Main.main(Main.java:40)

Caused by: HTTP Status-Code 407: Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy filter is denied. )

at com.sun.xml.rpc.client.http.HttpClientTransport.checkResponseCode(HttpClientTransport.java:319)

at com.sun.xml.rpc.client.http.HttpClientTransport.connectForResponse(HttpClientTransport.java:252)

at com.sun.xml.rpc.client.http.HttpClientTransport.invoke(HttpClientTransport.java:88)

at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:96)

at lombamarc.moneyconv.CurrencyConvertorSoap_Stub.conversionRate(CurrencyConvertorSoap_Stub.java:87)


Watsh Rajneesh
Ranch Hand

Joined: Apr 17, 2006
Posts: 110
And this error is after you have set the http.proxyUser and http.proxyPassword properties also (ie together with http.proxyHost and http.proxyPort)? I have seen this to work in my case in past. I was using Axis 1.2 then in my setup.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Generated Stub and Proxy Settings !!
 
Similar Threads
Proxy authentication errors
Invoking a web service behind a proxy server
proxy settings in servlet
Credentials cannot be used for NTLM authentication
Weblogic Eclipse Proxy