Solved web service blocked by ISA server  407 error

Posted on 2005-04-10
Last Modified: 2008-01-09
*        I have a web service all up and working in my vb-dot-net code, talking from my XP laptop to my web server - no problem.
*        Internally all is well and from home to work all is fine also.
*        In the weekend I attempted to install the program on PC’s at a clients site, this is when the problem started – they have an ISA server with user authenticate turned on –my  web service will no longer talk to the web server.

Every time the program runs the following turns up in the ISA web log and the program does not work (Ip addresses and names changed to protect the innocent - ha ha).

NOTE: Microsoft ISA Server 2000 Version 3.0.1200.166 SP1
          Developing with Microsoft visual studio .net 2003   anonymous  Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 1.1.4322.573)          2005-04-09    04:01:28       XXXXISA       -          -        80      -        374          4550   http    POST         -          407

From what I have ‘googled’ - The 407 at the end indicates that my web service need to authenticate to get through the ISA web.  

Now for some code…..

‘    Initially I had the following (the web service returns a string to the client):

Dim wWXRwebserviceswebref As New WXRwebservices.WXRwebservices
wWXRwebserviceswebref.Timeout = 15000 ' in milliseconds (15 seconds)
‘ (by the way the web services still takes longer than 15 seconds to time out - ideas anyone)

Dim wAction as string = “”

  wAction = wWXRWebClientServicesRef.WinXRay(wWXRsid)
catch ex as exception
end try

‘         This worked great for my pc at home
‘         At the client with the ISA server on and the error above I ‘googled’ and found this to try

  wAction = wWXRWebClientServicesRef.WinXRay(wWXRsid)
catch ex as exception
      Dim wMyCredentials As New System.Net.CredentialCache
      Dim wNetCred As New NetworkCredential(“login", "password")
      wMyCredentials.Add(New Uri(wWXRwebserviceswebref.Url), "Basic", wNetCred)
      wWXRwebserviceswebref.Credentials = wMyCredentials
      wAction = wWXRWebClientServicesRef.WinXRay(wWXRsid)
   catch ex2 as exception
   end try                
end try

‘ This had no improvement, still an anonymous failure in the ISA log!.

‘   What is the story with the “Basic” in the credentials example above also, are there a number of other options I should try like encrypted or something? – I am happy to have a number of ‘try’, exceptions in my code to eventually talk to the web service?
‘ I have tried adding the proxy settings picked up from the users explorer settings out of the registry i.e - I am not sure if I need to do this but have tried with and without these settings – same ISA error  i.e - wWXRWebClientServicesRef.Proxy = New System.Net.WebProxy("")

All help would be most appreciated


Karl Spurling
New Zealand
Question by:kxs
    LVL 10

    Expert Comment

    Hi Karl

    From memory you need to add the credentials to your new WebProxy & then set your web service reference to use this new proxy, something like the following, you might also need to include the Domain in your network credentials

    Dim tmpproxy As WebProxy
    tmpproxy =  New System.Net.WebProxy("",8080)
    tmpproxy.Credentials = New NetworkCredential(“login", "password")    'You might also need the domain here
    wWXRwebserviceswebref.Proxy = tmpproxy
    wAction = wWXRWebClientServicesRef.WinXRay(wWXRsid)

    I'm not at my development machine at the moment so cant be sure of the above syntax, but this might get you going

    Also from Auckland, New Zealand

    Author Comment

    Thanks Andy,

    I would like to pick up the default credentials from the cache and not have to either prompt the user for a login and password or hard code one into the application.

    Last night I tried the following again resulting in a 407 error in the ISA log?

                ' Add the User Credentials and try that
                wRegHkcu = Registry.CurrentUser
                wRegKey = wRegHkcu.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Internet Settings\", False)
                If Not IsNothing(wRegKey) AndAlso Not IsNothing(wRegKey.GetValue("ProxyEnable")) Then
                    If wRegKey.GetValue("ProxyEnable") = 1 Then
                        If Not IsNothing(wRegKey.GetValue("ProxyServer")) Then
                            Dim wYourWebProxy As String = "h" & "ttp://" & wRegKey.GetValue("ProxyServer") & "/"
                            wWXRWebClientServicesRef.Proxy = New System.Net.WebProxy(wYourWebProxy)
                            wWXRWebClientProxy = wYourWebProxy
                        End If
                    End If
                End If
                wTmpProxy.Credentials = wMyCredentials.DefaultCredentials
                wWXRWebClientServicesRef.Proxy = wTmpProxy
                    wAction = wWXRWebClientServicesRef.WinXRay(wWXRsid)
                Catch ex As Exception
                End Try

    Any further comments would be appreciated, as always I am looking for the 'silver bullet' code to access the web service from all firewalls.

    Go the Bluse, the Black Caps, the Warriors, the All Blacks and Lion Red - ha ha


    LVL 10

    Accepted Solution

    Hi Karl

    Try changing this line

    wTmpProxy.Credentials = wMyCredentials.DefaultCredentials


    wTmpProxy.Credentials = System.Net.CredentialCache.DefaultCredentials

    If this doesn't work then you might need to explicitly configure your ISA server to allow access to that website on port 8080, you should be able to confirm this by entering the URL in your webbrowser & seeing if you can get to it from there.

    If you need info on configuring ISA server then a good site is


    Featured Post

    Courses: Start Training Online With Pros, Today

    Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

    Join & Write a Comment

    Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
    The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now