The next generation Fraud Detection API is available. Sign up FraudLabs Pro now!
homeHome homeMy Account

Connecting FraudLabs.com Web Service behind Proxy Server


If you are behind a proxy server, you might getting exception while trying to access web services. Here is some tips of proxy settings where you can specify the proxy address when connecting to web services.

1. Configure the proxy server as in the following:

ASP.NET (C#)

WebProxy myProxy = new WebProxy("http://proxyserver:port",true);
myWS myWebService = new myWS();
myWebService.Proxy = myProxy;


ASP.NET (VB.NET)

Dim myProxy As New WebProxy("http://proxyserver:port", True)
Dim myWebService As New myWS()
myWebService.Proxy = myProxy

2. Configure your machine.config file or web.config file if your application proxy settings are the same for all the users, but different from default IE settings:

Machine.config

<defaultProxy>
<proxy proxyaddress = "http://proxyserver:port" bypassonlocal = "true" />
</defaultProxy>

web.config

<system.net>
<defaultProxy>
<proxy proxyaddress = "http://proxyserver:port" bypassonlocal = "true" />
</defaultProxy>
</system.net>

3. Configure the proxy server as in the following if your proxy server requires authentication:

ASP.NET (C#)

WebProxy myProxy = new WebProxy("http://proxyserver:port",true);
myProxy.Credentials = new NetworkCredential("username", "password", "domain");
myWS myWebService = new myWS();
myWebService.Proxy = myProxy;


ASP.NET (VB.NET)

Dim myProxy As New WebProxy("http://proxyserver:port", True)
myProxy.Credentials = New NetworkCredential("username", "password", "domain")
Dim myWebService As New myWS()
myWebService.Proxy = myProxy

Java

//Set the http proxy to webcache.mydomain.com:8080
System.setProperty("http.proxyHost", "webcache.mydomain.com");
System.setPropery("http.proxyPort", "8080");
// Next connection will be through proxy.
URL url = new URL("http://java.sun.com/");
InputStream in = url.openStream();
// Now, let's 'unset' the proxy.
System.setProperty("http.proxyHost", null);