Add Web References problems

Discussion in 'ASP .Net Web Services' started by Russ, Apr 23, 2004.

  1. Russ

    Russ Guest

    Hi All. I'm brand new to this but 3 days of working on it and scanning
    literally thousands of user group messages has not solved my problem.

    I have VS.Net 2003 installed on my dev machine (Win2K), and the server
    components on my dev server (Win2K server), along with .net framework
    v1.1. I am trying to go through the walkthrough titled "Creating a
    Distributed Application".

    I can create the WebService ok, on the server, but when I try to
    create the client (on the dev machine), when I get to the step of
    adding a web reference to the WebServer, one of the following happens.

    A) If I add the line <identity impersonate="true"/> to the web.config
    file, then I get an access denied error when trying to read
    AuthorsService.asmx from the server. The stack trace it shows does me
    absolutely no good as I have not a clue what all the numbers mean...

    I have uninstalled the framework and reinstalled. On the server, in
    the Local Security Policy, User Rights Assignment for "Impersonate a
    Client after authentication" I have added the APSNET user. I also
    added myself to the VS Developers group on the server. The server is
    a domain controller, and I am the same user with same password on both
    machines, and I am an administrator on both machines. I just don't
    have a clue what to do about this.

    B) I tried removing the line <identity impersonate="true"/> from the
    Web.config file. This allows the asmx file to be read with no
    problem. However when I tell it to "add reference", It does, but the
    task window in VS shows the following error:

    "E:\testNet\AuthorsWinClient\Web References\asrv\Reference.map(1):
    Custom tool warning: DiscoCodeGenerator unable to initialize code
    generator. No code generated."

    I can find very little references to "DiscoCodeGenerator" via a google
    search or via scanning the user groups, and what I did find does not
    seem to address this problem.

    The result of this seems to be that when I try to add the DataSet
    control to the client, there are "no datasets in project". So I am at
    a standstill in trying to learn more of this until someone can help me
    fix this.

    I do realize that I can install IIS on my dev machine, and maybe make
    it work that way, but according to the article "Remote Server
    Configuration for Developing Web Projects Using Visual Studio .NET" at
    the url below, what I am doing should work.

    Please help! Thanks, Russ


    http://msdn.microsoft.com/library/d...developingwebprojectsusingvisualstudionet.asp
    Russ, Apr 23, 2004
    #1
    1. Advertising

  2. Hi Russ,

    Regarding on the issue, we're
    finding proper resource to assist you and we will update as soon as
    posible. Thanks for your understanding.

    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security(This posting is provided "AS IS",
    with no warranties, and confers no rights.)
    Steven Cheng[MSFT], Apr 24, 2004
    #2
    1. Advertising

  3. Russ

    [MSFT] Guest

    Hi Russ,

    There is a known issue when running ASP.NET on a domain controler:

    FIX: ASP.NET Does Not Work with the Default ASPNET Account on a Domain
    Controller
    http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q315158

    I suggest you may use System account instead first to see if this will help.

    Luke
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
    [MSFT], Apr 26, 2004
    #3
  4. Russ

    Russ Guest

    Luke, thank you for the response. However I do not think it will
    solve the problem. The article you refer me to is to correct a
    problem with the .net framework version 1.0. Since I am using version
    1.1 (I don't even have 1.0 installed), there is no path:
    %Systemroot%\Microsoft.NET\Framework\v1.0.3705\CONFIG

    I did try making the change in the V1.1\CONFIG\machine.config file,
    and all the other changes suggested by the article to allow the use of
    the ASPNET account (changing password, etc). The article recommends
    this over using the System account due to security reasons, but
    honestly I don't understand why since the ASPNET account has access
    priviliges to everything.

    Anyway when I made the changes, I started getting a lot of other error
    messages. I can post them if you want, but because that was a V1.0
    framework fix, I expect that I should put things back the way they
    were and wait for you to come up with a different answer to my
    dilemma.

    Thanks for your continuing help.

    Russ

    On Mon, 26 Apr 2004 06:41:43 GMT,
    ([MSFT]) wrote:

    >Hi Russ,
    >
    >There is a known issue when running ASP.NET on a domain controler:
    >
    >FIX: ASP.NET Does Not Work with the Default ASPNET Account on a Domain
    >Controller
    >http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q315158
    >
    >I suggest you may use System account instead first to see if this will help.
    >
    >Luke
    >Microsoft Online Support
    >
    >Get Secure! www.microsoft.com/security
    >(This posting is provided "AS IS", with no warranties, and confers no
    >rights.)
    Russ, Apr 26, 2004
    #4
  5. Russ

    [MSFT] Guest

    Hi Russ,

    The problem mentioned in the KB article is still with framework 1.1 since
    it is a permission issue with a DC. In the web.config, you have specified
    <identity impersonate="true"/>. This requires impernate after
    authentication. However, the ASPNET account may not have enough permission
    to perform impersonate. Therefore, I suggest you begin with System account
    and an ASP.NET project (it is easier to debug than a web service). See what
    is the result you will get. If the ASP.NET project, then go on with a web
    service project.

    Luke
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
    [MSFT], Apr 27, 2004
    #5
  6. Russ

    Russ Guest

    Thank you Luke. I will do that. Maybe you should look into fixing the
    KB article because it clearly says:

    > STATUS
    > Microsoft has confirmed that this is a bug in the Microsoft
    > products that are listed at the beginning of this article. This
    > bug was corrected in ASP.NET (included with the .NET Framework) 1.1.


    Also, the bug that the KB article (#315158) describes does not seem to
    exactly fit the results I am seeing. For instance it says that I will
    see the messages:

    > Server Application Unavailable"
    >
    > The web application you are attempting to access on this web server
    > is currently unavailable."
    >
    > Please hit the "Refresh" button in your web browser to retry your request"


    which I do not see, and that there will be an event logged in the
    system app log:

    > aspnet_wp.exe could not be launched because the username and/or
    > password supplied in the processModel section of the config file are
    > invalid.
    > aspnet_wp.exe could not be started.
    > HRESULT for the failure: 80004005 "


    I see nothing logged when my WebService fails - But I will take your
    advice and try an ASP.NET project with the system account.

    Thanks again, Russ



    On Tue, 27 Apr 2004 03:29:33 GMT,
    ([MSFT]) wrote:

    >Hi Russ,
    >
    >The problem mentioned in the KB article is still with framework 1.1 since
    >it is a permission issue with a DC. In the web.config, you have specified
    ><identity impersonate="true"/>. This requires impernate after
    >authentication. However, the ASPNET account may not have enough permission
    >to perform impersonate. Therefore, I suggest you begin with System account
    >and an ASP.NET project (it is easier to debug than a web service). See what
    >is the result you will get. If the ASP.NET project, then go on with a web
    >service project.
    >
    >Luke
    >Microsoft Online Support
    >
    >Get Secure! www.microsoft.com/security
    >(This posting is provided "AS IS", with no warranties, and confers no
    >rights.)
    Russ, Apr 28, 2004
    #6
  7. Russ

    [MSFT] Guest

    Hi Russ,

    Thank you for the information. To use impersonate, System account is a
    better choice than ASPNET. You may try this and let me know the result. If
    you have any further question, please feel free to let mw know.

    Luke
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
    [MSFT], Apr 28, 2004
    #7
  8. Russ

    Russ Guest

    Luke, I removed and reinstalled the .net framework 1.1 and then
    changed the userName in machine.config to "SYSTEM". This solved the
    problem of <identity impersonate="true"/> causing a problem.

    I can now read the asmx file when I try to add a web reference, and it
    gives me no errors. However when I actually tell it to add a
    reference to my AuthorsWinClient project, I still get the error:

    "E:\testNet\AuthorsWinClient\Web References\asrv\Reference.map(1):
    Custom tool warning: DiscoCodeGenerator unable to initialize code
    generator. No code generated."

    So when I try to add the DataSet control to the client, there are "no
    datasets in project". What do you suggest?

    Thank you, Russ


    On Tue, 27 Apr 2004 03:29:33 GMT,
    ([MSFT]) wrote:

    >Hi Russ,
    >
    >The problem mentioned in the KB article is still with framework 1.1 since
    >it is a permission issue with a DC. In the web.config, you have specified
    ><identity impersonate="true"/>. This requires impernate after
    >authentication. However, the ASPNET account may not have enough permission
    >to perform impersonate. Therefore, I suggest you begin with System account
    >and an ASP.NET project (it is easier to debug than a web service). See what
    >is the result you will get. If the ASP.NET project, then go on with a web
    >service project.
    >
    >Luke
    >Microsoft Online Support
    >
    >Get Secure! www.microsoft.com/security
    >(This posting is provided "AS IS", with no warranties, and confers no
    >rights.)
    Russ, Apr 29, 2004
    #8
  9. Russ

    [MSFT] Guest

    Hi Russ,

    Can you compile the Web service project and try to run it (A IE windows
    will prompt you to test the web service)? If not, what is the error
    Message? Additionally, from the error message in your message, I suspect if
    the VS.NET has been installed completely. Can you not be able use a dataset
    in any project?


    Luke
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
    [MSFT], Apr 30, 2004
    #9
  10. Russ

    Russ Guest

    Luke, when I run the web service from Visual Studio, IE comes up with
    a mostly blank page that says "Service1" in a blue bar across the top,
    and the next line says:

    > The following operations are supported. For a formal definition,
    > please review the Service Description.


    This appears to work properly??

    I am a little concerned about the name "Service1" appearing like that.
    Service1 is the name of the class in the AuthorsService.asmx file, and
    I don't know why it should appear in the generated Web page. I see
    that "Service1" is set to be the service name (as shown below), but
    how did it get set that way? If this is normal behaviour then fine,
    but I wanted to point it out in case it is part of the problem. I
    would have thought the service name would be "AuthorsWebService".

    When I click on the link "Service Description", I get the following:

    > <?xml version="1.0" encoding="utf-8" ?>
    > - <definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://asrv/webservices/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" targetNamespace="http://asrv/webservices/" xmlns="http://schemas.xmlsoap.org/wsdl/">
    > <types />
    > <service name="Service1" />
    > </definitions>



    As for adding a dataset, yes, I was able to add a dataset when
    building the walkthrough named "Walkthrough: Simple Data Access in a
    Windows Form", and the program works correctly. This was a C++
    project, not a C# project though..

    Russ

    On Fri, 30 Apr 2004 06:32:37 GMT,
    ([MSFT]) wrote:

    >Hi Russ,
    >
    >Can you compile the Web service project and try to run it (A IE windows
    >will prompt you to test the web service)? If not, what is the error
    >Message? Additionally, from the error message in your message, I suspect if
    >the VS.NET has been installed completely. Can you not be able use a dataset
    >in any project?
    >
    >
    >Luke
    >Microsoft Online Support
    >
    >Get Secure! www.microsoft.com/security
    >(This posting is provided "AS IS", with no warranties, and confers no
    >rights.)
    Russ, Apr 30, 2004
    #10
  11. Russ

    Russ Guest

    Luke, here is some followup information. I have been studying the
    problem more...

    When I get the error:

    > E:\testNet\AuthorsWinClient\Web References\asrv\Reference.map(1): Custom tool warning: DiscoCodeGenerator unable to initialize code generator. No code generated.


    It references the file ReferenceMap, line 1. Here is that file:


    > <?xml version="1.0" encoding="utf-8"?>
    > <DiscoveryClientResultsFile xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    > <Results>
    > <DiscoveryClientResult referenceType="System.Web.Services.Discovery.DiscoveryDocumentReference" url="http://asrv/AuthorsWebService/AuthorsService.asmx?disco" filename="AuthorsService.disco" />
    > <DiscoveryClientResult referenceType="System.Web.Services.Discovery.ContractReference" url="http://asrv/AuthorsWebService/AuthorsService.asmx?wsdl" filename="AuthorsService.wsdl" />
    > </Results>
    > </DiscoveryClientResultsFile>


    Is there any problem with the file?


    ALSO: You said "I suspect if the VS.NET has been installed
    completely", based on the error message above. I took that to mean
    that maybe disco.exe was not executing.

    First I looked to be sure that Disco.exe exists. I found it at:

    E:\Program Files\Microsoft Visual Studio .NET
    2003\SDK\v1.1\Bin\disco.exe

    Next, I wanted to see if that directory was included in the execute
    dir's of Visual Studio. I found (under tools/options/executable
    files, in projects/VC++ Directories): $(FrameworkSDKDir)bin. That is
    how I expect VS finds the disco.exe file. (However I did not find any
    C# Directories references.)

    But when I looked at system or personal environment variables there
    was no entry for "FrameworkSDKDir". So I added one, setting it to
    E:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\

    This did not help, the error message when trying to add a Web
    reference is the same. From what I can tell, the problem is not that
    disco does not execute, but that it has a problem with the map file.

    I tried executing the disco program manually from command line. Here
    is what I got:

    E:\testNet\AuthorsWinClient\Web
    References\asrv>e:\progra~1\micros~1.net\sdk\v1.1\bin\disco
    http://asrv/AuthorsWebService/AuthorsService.asmx?disco
    Microsoft (R) Web Services Discovery Utility
    [Microsoft (R) .NET Framework, Version 1.1.4322.573]
    Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.

    Disco found documents at the following URLs:
    http://asrv/AuthorsWebService/AuthorsService.asmx?disco
    http://asrv/AuthorsWebService/AuthorsService.asmx?wsdl

    The following files hold the content found at the corresponding URLs:
    .\AuthorsService.disco <-
    http://asrv/AuthorsWebService/AuthorsService.asmx?disco
    .\AuthorsService.wsdl <-
    http://asrv/AuthorsWebService/AuthorsService.asmx?wsdl
    The file .\results.discomap holds links to each of these files.

    I really don't know where to turn next...

    Thanks, Russ


    On Fri, 30 Apr 2004 06:32:37 GMT,
    ([MSFT]) wrote:

    >Hi Russ,
    >
    >Can you compile the Web service project and try to run it (A IE windows
    >will prompt you to test the web service)? If not, what is the error
    >Message? Additionally, from the error message in your message, I suspect if
    >the VS.NET has been installed completely. Can you not be able use a dataset
    >in any project?
    >
    >
    >Luke
    >Microsoft Online Support
    >
    >Get Secure! www.microsoft.com/security
    >(This posting is provided "AS IS", with no warranties, and confers no
    >rights.)
    Russ, May 2, 2004
    #11
  12. Russ

    [MSFT] Guest

    Hi Russ,

    From the information, you haven't added any web method in the web service.
    A web service must have at least one web method, so that it can be added to
    other projects. Otherwise, there will be such a problem as you said. You
    can try to add a web method to the service code to see the result.

    By the way, string "service1" in IE when you test the web service, is just
    the class name you defined in the service code, like:

    public class Service1 : System.Web.Services.WebService
    {
    ...

    Luke
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
    [MSFT], May 4, 2004
    #12
  13. Russ

    Russ Guest

    Ok Luke. My problem is finally sorted out. I did add the Web method,
    but it did not work. The reason is because of my unfamilarity with
    C#. In the generated code it has the string "// [Webmethod]". Note
    that it is commented out. Following that is a Hello World method that
    is also commented out.

    When the tutorial told me to insert Web Methods, I replaced the Hello
    world method code, but did not uncomment the [WebMethod] line. I
    thought it was supposed to be a comment line (since it was already
    commented out).

    Once you told me the problem was that I had no Web Method, I guessed
    that line was not a comment, and fixed it.

    Now I have successfully added a Web Reference.

    I would suggest that somewhere an error message should be generated to
    tell users that the problem is no web methods, rather than just
    getting the very unrelated message about disco not being able to
    initialize the code generator.

    Thank you much for your time and patience helping me through these
    beginner woes. C++ is SO MUCH easier!!! (because I already know it).

    Regards, Russ

    On Tue, 04 May 2004 05:59:14 GMT,
    ([MSFT]) wrote:

    >Hi Russ,
    >
    >From the information, you haven't added any web method in the web service.
    >A web service must have at least one web method, so that it can be added to
    >other projects. Otherwise, there will be such a problem as you said. You
    >can try to add a web method to the service code to see the result.
    >
    >By the way, string "service1" in IE when you test the web service, is just
    >the class name you defined in the service code, like:
    >
    >public class Service1 : System.Web.Services.WebService
    >{
    >..
    >
    >Luke
    >Microsoft Online Support
    >
    >Get Secure! www.microsoft.com/security
    >(This posting is provided "AS IS", with no warranties, and confers no
    >rights.)
    Russ, May 4, 2004
    #13
  14. Russ

    [MSFT] Guest

    Hi Russ,

    I glad to heard the good news. Without the "[Webmethod]", the method will
    be treated as normal method, which can only be called in the web service
    internally, we have to add "[Webmethod]" for a public method.

    Regards,

    Luke
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
    [MSFT], May 5, 2004
    #14
  15. Russ

    Guest

    Russ
    I Confront the same problem do you have the answer yet???

    **********************************************************************
    Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
    Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
    , May 9, 2004
    #15
    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. Roger Leigh
    Replies:
    8
    Views:
    422
    Karl Heinz Buchegger
    Nov 17, 2003
  2. Replies:
    3
    Views:
    438
    Victor Bazarov
    Nov 10, 2004
  3. DanielEKFA
    Replies:
    8
    Views:
    592
    DanielEKFA
    May 16, 2005
  4. Replies:
    8
    Views:
    697
    Bruno Desthuilliers
    Dec 12, 2006
  5. Lars Willich
    Replies:
    13
    Views:
    823
    Ian Shef
    Oct 23, 2007
Loading...

Share This Page