Error creating instance for Web Service referece in ASP.Net 3.5 C#

Posted on 2011-10-10
Last Modified: 2012-06-21
----Trying to learn Web Services----

Unable to create instance of the WebService reference in ASP.Net 3.5 using  VS2010.

- Added web reference successfully to my Project -> References-> WebReference ->  example:- "".
                   "" is the name of my reference.
- in my project file default.cs myws = new;     -> error
   " a namespace but used like type"

pls let me know if i'm missing any thing.


Question by:kishan66
    LVL 28

    Accepted Solution

    by: is the webservice namespace. you have to create an instance of the correct object in the namespace. Most likely: myws = new;
    LVL 16

    Assisted Solution


    The web service that you added and named is NOT a type. It's a container.

    If you type that name and hit "." to get the context drop-down you'll see that it contains types within it. In your example, you want to use "" as the type to instantiate.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    728 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

    17 Experts available now in Live!

    Get 1:1 Help Now