permaculture playing cards*
The moose likes Web Services and the fly likes Can get to wsdl with browser but cannot connect with the client Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Can get to wsdl with browser but cannot connect with the client" Watch "Can get to wsdl with browser but cannot connect with the client" New topic
Author

Can get to wsdl with browser but cannot connect with the client

John Landon
Ranch Hand

Joined: Sep 25, 2008
Posts: 227
Hi,
I have jax-ws web service on mt local host. I also have the client on the local host. On my machine the client consumes the service fine. But when I am behind proxi and the service is consumed from remote host it doesn't work. The interesting thing is that you can access the wsdl on the browser on the remote host but when you run the client it's communication error.

Thanks.
Chintan Rajyaguru
Ranch Hand

Joined: Aug 19, 2001
Posts: 341
This is probably because your browser is setup correctly with proxy settings so it can show wsdl but your client isn't so it doesn't work.

To fix this issue, most runtimes provide passing properties at the time of code generation, something like
-Dproxy.httpHost=yourPproxyHost -Dproxy.httpPort=yourProxyPort
Check the documentation of your runtime to see what properties to pass.

You may also be able to do this in code
System.getProperties().setProperty("http.proxyUser ", userid);
But again, your runtime should dictate the name of the property to use. Remember to set username and password properties as well if the proxy requires authentication


ChintanRajyaguru.com
SOADevelopment.com - Coming soon!
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
For a C# client you have to change the configuration file (the client's web.config) or create a System.Net.WebProxy instance, configure it, and then attach it to the web service proxy.



PRB: Error on .NET client that consumes a Web service through an HTTP proxy server

Be sure to specify the port number in the settings especially if you are using SSL (typically port 443).
Web service, web proxy and timeout problem
Vinod K Singh
Ranch Hand

Joined: Sep 30, 2008
Posts: 198
An example of working with proxies is available here. I have tested it with Tomcat.


My Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can get to wsdl with browser but cannot connect with the client