Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / November 2005

Tip: Looking for answers? Try searching our database.

Problem with C# Using Statement on Web Services Proxy

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bill - 09 Nov 2005 12:29 GMT
I used wsdl.exe to build a C# web services proxy.  It contains 2 using
statements that cause compile errors in Visual Studio .NET beta 2:

// the following 2 lines cause compile errors
using System.Web.Services;
using System.Web.Services.Protocols;
//

Here is a simple console program that also yields the same compile errors:

using System;
using System.Collections.Generic;
using System.Text;

// the following 2 lines cause compile errors
using System.Web.Services;
using System.Web.Services.Protocols;

namespace ConsoleApplication1
{
 class Program
 {
   static void Main(string[] args)
   {
     Console.WriteLine("Hello World!");
   }
 }
}

Here are the compile error messages:

Error   1          The type or namespace name 'Services' does not exist in
the namespace 'System.Web' (are you missing an assembly reference?)
C:\Documents and Settings\bkellett\My Documents\Visual Studio
2005\Projects\ConsoleApplication1\ConsoleApplication1\Program.cs        6
18            ConsoleApplication1

Error   2          The type or namespace name 'Services' does not exist in
the namespace 'System.Web' (are you missing an assembly reference?)
C:\Documents and Settings\bkellett\My Documents\Visual Studio
2005\Projects\ConsoleApplication1\ConsoleApplication1\Program.cs        7
18            ConsoleApplication1

According to doc, these using statements appear to be correct.  Can you tell
me what to do?

Here is info on the versions of s/w I am using:

Visual Studio 2005 Version 8.0.50215.44 (beta2.050215-4400)
.NET Framework Version 2.0.50215

Any assistance greatly appreciated!
Steven Cheng[MSFT] - 10 Nov 2005 02:28 GMT
Hi Bill,

Welcome to ASPNET newsgroup.
From your description, you're consuming a c# websevice in a C# console
client application through the VS.NET 2005 beta IDE. However, you're
encountering "namespace not found...." error when compiling the client
program (with the autogenerated proxy), yes?

From the code snippet you provided, the namespace you imported are correct.
And I think the problem is likely caused by the assembly which contains the
namespace are not referenced in your client project.  From MSDN doc, we can
find that

System.Web.Services and all its sub namespaces are all contains in the

System.Web.Services.Dll  rather than System.Web.Dll

So please make sure that you've correctly referenced the
System.Web.Services.Dll in your client project.
BTW, since the VS.NET 2005 RTM has been available , we recommend that we no
longer use the beta products and move onto the released version.

Thank you!

Steven Cheng
Microsoft Online Support

Signature

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
| From: "Bill" <bk@nospam.nospam>
| Subject: Problem with C# Using Statement on Web Services Proxy
[quoted text clipped - 10 lines]
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservices:30821
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
|
[quoted text clipped - 50 lines]
|
| Any assistance greatly appreciated!
Bill - 11 Nov 2005 14:22 GMT
Steven, perfect answer, many thanks!

> Hi Bill,
>
[quoted text clipped - 107 lines]
> |
> | Any assistance greatly appreciated!
Steven Cheng[MSFT] - 12 Nov 2005 04:58 GMT
You're welcome Bill,

Regards,

Steven Cheng
Microsoft Online Support

Signature

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
| From: "Bill" <bk@nospam.nospam>
| References: <eMrYAlS5FHA.1184@TK2MSFTNGP12.phx.gbl>
<rNmLr5Z5FHA.3076@TK2MSFTNGXA02.phx.gbl>
| Subject: Re: Problem with C# Using Statement on Web Services Proxy
| Date: Fri, 11 Nov 2005 09:22:32 -0500
[quoted text clipped - 9 lines]
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservices:30858
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
|
[quoted text clipped - 111 lines]
| > |
| > | Any assistance greatly appreciated!

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.