What "using" statement to use for a web service in same project

Posted on 2007-08-07
Last Modified: 2013-12-17
I have a Windows Form program and a web service in the same project, and I have added a web reference so the Form can access the Web service. But what "using" statement do I use in the header of the file?

The namespace is WebService1 and the service is called Service1.

Also, what constructor do I use?

Question by:newbieweb
    LVL 10

    Accepted Solution

    Well, if you have added a reference to the webservice DLL, then you should just need to use the namespace WebService1 like so:

    using WebService1;

    also, for web services....try adding a reference to:

    using System.Web.Services;


    Author Comment

    WebService1 does not work.

    Under the Web References tab I have "localhost", actually.  When I look at the properties of localhost, I see:

    Folder Name: locahost
    URL Behavior: Dynamic
    Web Reference: http://localhost:1055/Service1.asmx

    Any suggestions?

    Author Comment

    Got it.


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Suggested Solutions

    Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
    Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    755 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

    24 Experts available now in Live!

    Get 1:1 Help Now