Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 28th, 2004, 01:16 PM
Authorized User
 
Join Date: Jun 2004
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default Compilation error . WebMethod

Hi all,
Can u guys see an error on line 26 ( in the web method). I have got an eeror on that line.
Thank U

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: BC32035: Attribute specifier is not a complete statement. Use a line continuation to apply the attribute to the following statement.

Source Error:



Line 24: 'their Session to TRUE
Line 25:
Line 26: <WebMethod(EnableSession:=true),SoapHeader("sHeade r",Direction:=SoapHeaderDirection.InOut,Required:= true)> pubilc function SignIn() As boolean
Line 27: 'check the username and the password passed in the SOAPHeader
Line 28:

<WebMethod(EnableSession:=true),SoapHeader("sHeade r",Direction:=SoapHeaderDirection.InOut,Required:= true)> pubilc function SignIn() As boolean



The main code is:

<%@ WebService Language="VB" Class="Service1" %>

Imports System
Imports System.Data
Imports System.Data.OleDb
Imports System.Configuration
Imports System.Web.Services
Imports Microsoft.VisualBasic.ControlChars
Imports System.XML.Serialization
Imports System.Web.Services.Protocols

'1) Create the public class SOAPHeaders

public class SOAPAuthHeader:Inherits SoapHeader
       public parameter1 As String
       public Parameter2 As String
End Class

public class service1:Inherits WebService
       public sHeader As SOAPAuthHeader


'Checks that the username and password are good. If they pass the test then set their Session to TRUE

<WebMethod(EnableSession:=true),SoapHeader("sHeade r",Direction:=SoapHeaderDirection.InOut,Required:= true)> pubilc function SignIn() As boolean
'check the username and the password passed in the SOAPHeader

       If ((sHeader.Parameter1.ToString() = "admin") AND (sHeader.Parameter2.ToString() = "password") ) Then
           'HTTPContext.session("IsLoggedIn") =true
           'HTTPContext.Current.session("IsLoggedIn") = true

            Context.Session("IsLoggedIn") = true
            return true
       Else
           Context.Session("IsLoggedIn") = false
           return false
       End If

    End function


 
Old June 28th, 2004, 01:46 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

pubilc?
 
Old June 30th, 2004, 10:35 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hello,

There is no _ to continue the line as shown above; the question is, is that the case for your code or is that the word wrap that's causing that?

<WebMethod(EnableSession:=true),SoapHeader("sHeade r",Direction:=SoapHeaderDirection.InOut,Required:= true)> pubilc function SignIn() As boolean

Might need to be:

<WebMethod(EnableSession:=true), _
SoapHeader("sHeader",Direction:=SoapHeaderDirectio n.InOut,Required:=true)> pubilc function SignIn() As boolean

Brian





Similar Threads
Thread Thread Starter Forum Replies Last Post
C++ Compilation error indupriyav C++ Programming 0 February 5th, 2007 08:37 AM
WebMethod Error when return type is a dataset Hagop .NET Web Services 2 August 18th, 2005 09:13 AM
Webmethod error while return type is a dataset Hagop General .NET 1 August 10th, 2005 05:46 AM
error on Webmethod when return type is a dataset Hagop General .NET 1 August 10th, 2005 05:45 AM
compilation error msrnivas .NET Web Services 3 June 9th, 2004 07:19 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.