none
Visual Studio 2010: Can't access Sharepoint Web Services because of Discovery Credentials Prompt RRS feed

  • Question

  • I am trying to access the web services that are located in this url: http://<part_of_th_url_omitted>/_vti_bin/Lists.asmx. I have no problem accessing this URL using my broswer, that is, when I type the URL and my browser's address bar and press enter, I can see the list of the services that are available. I encounter no problem by accessing this site through my browser at all.

    However, when I try to access the services from that URL (http://<part_of_the_url_omitted>/_vti_bin/Lists.asmx), a Discovery Credential Dialog box prompts me for my username and password. SO what I do is I enter my username and password that I used to access the sharepoint using my browser, the problem is, the dialog box doesn't seem to accept the username and password that I enter as the dialog box is keep on appearing. WHat should I do?

    Below are the detailed steps on how I go about in adding the Web Services.

    1. From the Solution Explorer, I right click on the "Service References" folder.

    2. From the context menu that appears, I Click on "Add Service Reference...". The "Add Service Reference" Dialog box will appear.

    3. From the "Add Service Reference" dialog box, I click on the "Advanced,,," button which can be seen at the bottom-left of the dialog box. The "Service Reference Settings" Dialog box will appear.

    4. From the "Service Reference Settings" dialog box, I click on the "Add Web Reference..." dialog box. The "Add Web Reference" Dialog box will appear. This is the dialog box where I can type the URL of the service that I want to access. So I type "http://<part_of_the_url_omitted>/_vti_bin/Lists.asmx". AFter typing that, I click on the Go button (which is the green arrow button at the right of the address bar of this dialog box).

    5. After doing that, a prompt dialog box will appear which has the title "Windows Security" and it is aking for my username and password. SO what I do is I enter the Username and the Password that I use in accessing the sharepoint site (http://<part_of_the_url_omitted>/_vti_bin/Lists.asmx)

    6. The prompt seems to accept the Username and Password, but after that, a new dialog box appeared with the title "Discovery Credential" and it says "The Service 'http://<part_of_the_url_omitted>/_vti_bin/Lists.asmx' requires a username and password". SO what I do is I enter again the un and pw that I use to access the sharepoint site, the one that I used inm the previous dialog box.

    7 After entering the username and the password and clicking the OK button. The dialog box reappears still asking for a username and a  password, but this time, it shows a different message. It says "The Service 'http://<part_of_the_url_omitted>/_vti_bin/Lists.asmx/$metadata' requires a username and password". SO it really, what oonly changed is the URL, it has now the $metadata at the end. What do I do? I eneter the username and password again.

    8. After clicking Ok again, the dialog box reappears, now it says "The Service 'http://<part_of_the_url_omitted>/_layouts/1033/error.aspx' requires a username and password." Now it shows a very different username. Of ocurse, I still type in the username and password and click Ok.

    9. after doing that, the dialog box reappears again and it shows the same message as in step 6. So I do steps 6, 7 and 8 in a loop.

    10. When I finally get tired of entering the username and password, I click on cancel. The message box reappears again. So I click on cancel again. After doing that, I can then, surprisingly, see the list of the web services. However, not surprisingly, I still can't use it because the "Add Reference" button which I need to click in order to use the Web services is disabled. So I can only see the list of the services but I can't use it.

     

    WHat should I do??

    I have tried doint the steps seen here: http://support.microsoft.com/kb/896861 (which is disabling the loopback check, and specifying the hostnames in the BackConnectionHostNames registry at regedit)

    I also have my IIS Services turned on.

    What should I do?


    • Moved by John Saunders Tuesday, March 22, 2011 1:09 AM Yes, it's about the web services, but I suspect it's an issue of SharePoint credentials. (From:ASMX Web Services and XML Serialization)
    • Edited by Mike Walsh FIN Tuesday, March 22, 2011 7:27 AM Do not try to attract attention to your posts with unnecessary trailing ... at the end of your titles. Repeat and risk posts being deleted.
    Monday, March 21, 2011 11:46 PM

All replies

  • Please advise whether you are using VS 2010 with

    a) MOSS 2007

    b) SharePoint Server 2010

    c) Some other SharePoint product.

     

    Moderator pre-SP 2010 forums


    SP 2010 "FAQ" (mainly useful links): http://wssv4faq.mindsharp.com/default.aspx
    WSS3/MOSS FAQ (FAQ and Links) http://wssv3faq.mindsharp.com/default.aspx
    Both also have links to extensive book lists and to (free) on-line chapters
    • Marked as answer by Leoyi Sun Friday, April 1, 2011 2:20 AM
    • Unmarked as answer by Mike Walsh FIN Tuesday, August 9, 2011 4:24 PM
    Tuesday, March 22, 2011 7:29 AM
  • Hey!

    Did you ever get that sorted?  It seems like 100% of the same issue I'm running into on my end trying to create a reference to the web services.

    Thanks!

    Tuesday, August 9, 2011 3:41 PM
  • Note to people thinking (as one person did - now deleted as off-topic) of adding a question about a SP 2010 environment to it:

    This is a thread in a pre-SP 2010 forum and if the OP will not say which SP product he is using in response to a direct question, it continues to be - by default - a pre-SP 2010 question.

     

    Moderator pre-SP 2010 forums

     


    SP 2010 "FAQ" (mainly useful links): http://wssv4faq.mindsharp.com/default.aspx
    WSS3/MOSS FAQ (FAQ and Links) http://wssv3faq.mindsharp.com/default.aspx
    Both also have links to extensive book lists and to (free) on-line chapters
    Wednesday, August 24, 2011 2:28 PM
  • Hola:
      tenia el mismo problema
      la ruta del WCF  era: http://192.xxx.xxx.xxx.com:7199/_vti_bin/Archivo/SerPrueba.svc/MEX

      y marcaba el error:
        
    Los metadatos contienen una referencia que no se puede resolver: 'http://192.xxx.xxx.xxx:5699/_vti_bin/Archivo/SerPrueba.svc/MEX'.
    La solicitud HTTP no está autorizada con el esquema de autenticación de cliente 'Anonymous'. El encabezado de autenticación recibido del servidor era 'NTLM,Negotiate'.
    Error en el servidor remoto: (401) No autorizado.
    If the service is defined in the current solution, try building the solution and adding the service reference again.

    solutions:
    lo que sirvio como solucion fue cambiar la ip por el nombre del servidor
    a: http://utcam-xxxx-xxx.com:5199/_vti_bin/Archivo/SerPrueba.svc/MEX?wsdl
    me pidio el usuario y password del servidor donde esta el servicio web
    y listo, funciono el servicio

    espero haya apoyado en algo.
    bye
    Friday, November 22, 2013 11:00 PM
  • Please post your question to the Spanish language SharePoint forum or re-post it here in English. Mike (Ex-Moderator)

    SP 2013 "FAQ" (useful links): http://spf2013faq.mindsharp.com/default.aspx
    SP 2010 "FAQ" (useful links, book lists): http://wssv4faq.mindsharp.com/default.aspx
    WSS3/MOSS FAQ (FAQ; Books and Links) http://wssv3faq.mindsharp.com/default.aspx

    Saturday, November 23, 2013 4:56 AM