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