File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes How to setup proxy settings in SWT application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to setup proxy settings in SWT application" Watch "How to setup proxy settings in SWT application" New topic
Author

How to setup proxy settings in SWT application

gopi dasaraju
Greenhorn

Joined: May 09, 2008
Posts: 6
We have an SWT touchscreen application up and running remotely. Application interacts with the back-end server thru webservices.

Now for few terminals, we need to set proxy for client application to interact with the back-end server.

Currently, we are using direct calls to webservice [not thru proxy]

I need some examples, how to implement this proxy settings.

Ideas on this implementation will greatly help.

Thanks in advance.
gopi dasaraju
Greenhorn

Joined: May 09, 2008
Posts: 6
i found this code some articals but this works only at JVM level,it's not working axis request and responses.

public void methodName(Map<String, String> proxyMap){
Properties props= new Properties(System.getProperties());
props.put("http.proxySet", "true");
props.put("http.proxyHost", proxyMap.get("proxyHost"));
props.put("http.proxyPort", proxyMap.get("proxyPort"));
Properties newprops = new Properties(props);
System.setProperties(newprops);
}

thanks,
Gopi Dasaraju.
[ May 22, 2008: Message edited by: gopi dasaraju ]
gopi dasaraju
Greenhorn

Joined: May 09, 2008
Posts: 6
finally i found the solution..

public void addProxy(Stub stub){
Options options = stub._getServiceClient().getOptions();
HttpTransportProperties.ProxyProperties proxyProperties = new HttpTransportProperties.ProxyProperties();
proxyProperties.setProxyName("hosturl");
proxyProperties.setProxyPort(number);
options.setProperty(HTTPConstants.PROXY, proxyProperties);

}
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to setup proxy settings in SWT application