The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

import-bot (20211) [Avatar] Offline
#1
[Originally posted by dynecnn]

Hi,
When I try the example, I got such error as shown below.

My OS is Win2K professional, IE 6.0, Visual Studio.Net (academic).

Should I set something?

regards,

dyne


===================================
Compilation Error
Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.

Compiler Error Message: CS1519: Invalid token 'string' in class, struct, or
interface member declaration

Source Error:



Line 11: public class HelloService1 : WebService{
Line 12: [WebMethod(Description="Greet by name.")]
Line 13: pubic string Greet(string name){
Line 14: if (name == "") name = "Stranger";
Line 15: return "Hello, " + name + "!";


Source File: c:inetpubwwwroothelloservice1.asmx Line: 13

......

Microsoft (R) Visual C# .NET Compiler version 7.00.9466
for Microsoft (R) .NET Framework version 1.0.3705
Copyright (C) Microsoft Corporation 2001. All rights reserved.

c:inetpubwwwroothelloservice1.asmx(13,9): error CS1519: Invalid token
'string' in class, struct, or interface member declaration


import-bot (20211) [Avatar] Offline
#2
Re: web service in chapter 6. listing 6.1
[Originally posted by ekinated]


Is this a direct copy-n-paste from your source code?

If so, "pubic" (in line 13) should be "public"

> Line 11: public class HelloService1 : WebService{
> Line 12: [WebMethod(Description="Greet by name."smilie]
> Line 13: pubic string Greet(string name){
> Line 14: if (name == ""smilie name = "Stranger";
> Line 15: return "Hello, " + name + "!";
>
import-bot (20211) [Avatar] Offline
#3
thank you :)
[Originally posted by dynecnn]

thank you smilie