// Create instance of webservice
MyWebService ws = new MyWebService();
// Create NetworkCredential to authorize in proxy
NetworkCredential cr = new NetworkCredential("user", "pass");
// Create WebProxy and provide proxy url (or ip) and proxy port
WebProxy pr = new WebProxy("yourproxy.com", 8080);
// Set proxy credentials
pr.Credentials = cr;
// Set credentials to Webservice
ws.Proxy = pr;
// Now You can call webservice
ws.Method1();
|