Proxy issue

Discussion in 'ASP .Net Web Services' started by Fred, Oct 16, 2008.

  1. Fred

    Fred Guest

    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,

    --
    Fred
     
    Fred, Oct 16, 2008
    #1
    1. Advertising

  2. 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" <> skrev i meddelandet
    news:%...
    > 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,
    >
    > --
    > Fred
    >
     
    Jonny Bergdahl, Nov 20, 2008
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. vidy5300
    Replies:
    0
    Views:
    890
    vidy5300
    Jun 7, 2004
  2. Replies:
    0
    Views:
    1,652
  3. Karsten Wutzke
    Replies:
    1
    Views:
    899
    Steven Simpson
    Aug 20, 2007
  4. Klein Stéphane
    Replies:
    3
    Views:
    608
    Steve Holden
    Dec 20, 2009
  5. Alejandro Molina

    Proxy and non Proxy configurations

    Alejandro Molina, Jul 15, 2004, in forum: ASP .Net Security
    Replies:
    0
    Views:
    153
    Alejandro Molina
    Jul 15, 2004
Loading...

Share This Page