F
Fred
Hello,
We have a winforms application accessing a web service.
We try our application from a network protected by a proxy (ISA server
as it seems) in one of our clients.
It fails with a 407 error.
But accessing the service asmx page from IE succeed (we get the page
referenced in the wsdlHelpGenerator element of the web.config)
So I made a little console app to test different scenarii, because I am
not physically at our client company.
Here it is :
Sub Main()
Dim rep As String
My.WebServices.Service.Url = "http://ourUrl/Service.asmx"
Console.WriteLine(" -- TEST 1 --")
Try
rep = My.WebServices.Service.Test
Console.WriteLine("OK")
Catch ex As Exception
Console.WriteLine("Failed")
Console.WriteLine(ex.Message)
End Try
Dim proxy As New WebProxy("http://theirProxyUrl:8080", True)
My.WebServices.Service.Proxy = proxy
Console.WriteLine(" -- TEST 2 --")
Try
rep = My.WebServices.Service.Test
Console.WriteLine("OK")
Catch ex As Exception
Console.WriteLine("Failed")
Console.WriteLine(ex.Message)
End Try
Dim cred As ICredentials = CredentialCache.DefaultCredentials
My.WebServices.Service.Proxy.Credentials = cred
Console.WriteLine(" -- TEST 3 --")
Try
rep = My.WebServices.Service.Test
Console.WriteLine("OK")
Catch ex As Exception
Console.WriteLine("Failed")
Console.WriteLine(ex.Message)
End Try
Dim netcred As NetworkCredential =
CredentialCache.DefaultNetworkCredentials
My.WebServices.Service.Proxy.Credentials = netcred
Console.WriteLine(" -- TEST 4 --")
Try
rep = My.WebServices.Service.Test
Console.WriteLine("OK")
Catch ex As Exception
Console.WriteLine("Failed")
Console.WriteLine(ex.Message)
End Try
Console.WriteLine("Press [Enter] to exit.")
Console.ReadLine()
End Sub
End Module
As expected, we get 407 error at tests 1 and 2.
But a timeout error at tests 3 and 4.
In another client network, also protected by a proxy, our application
works, using IE proxy settings (as in TEST 1).
Our Url addresses another port than 80. But the network adminstrators
know it and they were supposed to allow our app to go out.
Do you have an idea where I can begin to search ?
Is my test program correct ?
Do you think it is a proxy parameters issue ?
Thanks,
We have a winforms application accessing a web service.
We try our application from a network protected by a proxy (ISA server
as it seems) in one of our clients.
It fails with a 407 error.
But accessing the service asmx page from IE succeed (we get the page
referenced in the wsdlHelpGenerator element of the web.config)
So I made a little console app to test different scenarii, because I am
not physically at our client company.
Here it is :
Sub Main()
Dim rep As String
My.WebServices.Service.Url = "http://ourUrl/Service.asmx"
Console.WriteLine(" -- TEST 1 --")
Try
rep = My.WebServices.Service.Test
Console.WriteLine("OK")
Catch ex As Exception
Console.WriteLine("Failed")
Console.WriteLine(ex.Message)
End Try
Dim proxy As New WebProxy("http://theirProxyUrl:8080", True)
My.WebServices.Service.Proxy = proxy
Console.WriteLine(" -- TEST 2 --")
Try
rep = My.WebServices.Service.Test
Console.WriteLine("OK")
Catch ex As Exception
Console.WriteLine("Failed")
Console.WriteLine(ex.Message)
End Try
Dim cred As ICredentials = CredentialCache.DefaultCredentials
My.WebServices.Service.Proxy.Credentials = cred
Console.WriteLine(" -- TEST 3 --")
Try
rep = My.WebServices.Service.Test
Console.WriteLine("OK")
Catch ex As Exception
Console.WriteLine("Failed")
Console.WriteLine(ex.Message)
End Try
Dim netcred As NetworkCredential =
CredentialCache.DefaultNetworkCredentials
My.WebServices.Service.Proxy.Credentials = netcred
Console.WriteLine(" -- TEST 4 --")
Try
rep = My.WebServices.Service.Test
Console.WriteLine("OK")
Catch ex As Exception
Console.WriteLine("Failed")
Console.WriteLine(ex.Message)
End Try
Console.WriteLine("Press [Enter] to exit.")
Console.ReadLine()
End Sub
End Module
As expected, we get 407 error at tests 1 and 2.
But a timeout error at tests 3 and 4.
In another client network, also protected by a proxy, our application
works, using IE proxy settings (as in TEST 1).
Our Url addresses another port than 80. But the network adminstrators
know it and they were supposed to allow our app to go out.
Do you have an idea where I can begin to search ?
Is my test program correct ?
Do you think it is a proxy parameters issue ?
Thanks,