Proxy issue

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,
 
J

Jonny Bergdahl

Your code seems fine.

The problem you are experiencing is almost certainly due to the ISA Server
configuration, which is hard to configure if you don't know what you are
doing. I am almost certain that the problem is related to the fact that your
service running at a non-standard port, and that it would have worked for
port 80 (Users seems to make loud noices if that port isnt't reachable :).
The administrator then probably set up a rule that says that the client
machine is allowed to communicate with that port, when he really should have
set that rule for the local machine instead (localhost is the actual client
address for outgoing calls via the internal proxy).

Besides, there is really no need for an ISA administrator to set up rules
forcing the users to set up proxy setting in the clients, as ISA Server is
able to intercept HTTP calls and forward them locally to the proxy.

Regards;
/jb

Fred said:
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,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top