I am using the following for standard rest calls where I can easily attach the proxy settings.
WebProxy proxyObject = new WebProxy("http://proxyserver:80/",true);
WebRequest req = WebRequest.Create("http://www.contoso.com");
req.Proxy = proxyObject;
But when i do the following call below, is there a property that i can add the Proxy settings to ?
string sourceUrl = DiscoURL.Text;
string outputDirectory = DiscoDir.Text;
DiscoveryClientProtocol client = new DiscoveryClientProtocol();
client.Credentials = CredentialCache.DefaultCredentials;
try {
DiscoveryDocument doc;
if (DiscoverMode.Value == "ReadAll")
{
DiscoveryClientResultCollection results = client.ReadAll(Path.Combine(DiscoDir.Text,
"results.discomap"));
SaveMode.Value = "NoSave";
}
else
{
if (DiscoverMode.Value == "DiscoverAny")
{
doc = client.DiscoverAny(sourceUrl);
}
else
{
doc = client.Discover(sourceUrl);
}
if (ResolveMode.Value == "ResolveAll")
client.ResolveAll();
else
{
if (ResolveMode.Value == "ResolveOneLevel")
client.ResolveOneLevel();
else
Status.Text = String.Empty;
}
}
}
catch (Exception e2)
{
DiscoveryResultsGrid.Columns.Clear();
Status.Text = e2.Message;
}
Is there a way i can attach my proxy setting to the call ?