By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,219 Members | 2,147 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,219 IT Pros & Developers. It's quick & easy.

Undefined when defined

P: n/a
I actually have 2 questions:

1) I am getting an error "Type 'TempClass1' is not defined"

Why?

Here is my DLL, where I have 3 classes defined outside of my Web Class:
AuthHeader, ServiceTicket and TempClass1
************************************************** ************************
<%@ WebService Class="SecureService" debug="True"%>

Imports System
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Data
Imports System.Data.SqlClient

<WebService( Namespace:="http://10.0.0.25/webservices" )> _
Public Class SecureService : Inherits WebService

Public AuthenticationHeader As AuthHeader

<WebMethod()> Public Function Login( username As String, password As
String ) As ServiceTicket

End Function

End Class

Public Class AuthHeader:Inherits SoapHeader
Public SessionKey As String
End Class

Public Class ServiceTicket:Inherits AuthHeader
Public IsAuthenticated As Boolean
Public SessionKey As String
Public Expiration As DateTime
End Class

Public Class TempClass1:Inherits ServiceTicket
Public TomsClass1Name As String
End Class
************************************************** **********************

My Web page is :
************************************************** *******************
<%@ Import Namespace="Services" %>

<Script runat="Server">

Sub Page_Load
Dim objSecureService As SecureService
Dim objServiceTicket As ServiceTicket
Dim objAuthHeader As AuthHeader
Dim objTempClass1 As TempClass1

objSecureService = New SecureService
objServiceTicket = Session( "ServiceTicket" )
objTempClass1 = new TempClass1

</Script>

<html>
<head><title>TestSecureService.aspx</title></head>
<body>

<asp:Label
id="lblLuckyNumber"
EnableViewState="False"
Runat="Server" />

</body>
</html>
************************************************** ********************

Why do I only get an error on TempClass1 and not on the others?

2) In my Web page I have:

<%@ Import Namespace="Services" %>

But I don't have Namespace Services. Is this an MS Namespace?

Thanks,

Tom
Apr 3 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"tshad" <ts**********@ftsolutions.com> wrote in message
news:uv**************@TK2MSFTNGP11.phx.gbl...
I actually have 2 questions:

1) I am getting an error "Type 'TempClass1' is not defined"

Why?
It turns out I can modify the Login function to all three class without any
problem, like:
************************************************** *****************
<WebMethod()> Public Function Login( username As String, password As
String ) As ServiceTicket
Dim objServiceTicket As new ServiceTicket
Dim objAuthHeader As new AuthHeader
Dim objTempClass1 As new TempClass1

End Function
************************************************** ****************

So I can call all these classes, which makes sense as they are all in the
same file.

But why can I use ServiceTicket and AuthHeader, but not TempClass1??????

They are defined the same way. They are in the same file.

Thanks,

Tom
Here is my DLL, where I have 3 classes defined outside of my Web Class:
AuthHeader, ServiceTicket and TempClass1
************************************************** ************************
<%@ WebService Class="SecureService" debug="True"%>

Imports System
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Data
Imports System.Data.SqlClient

<WebService( Namespace:="http://10.0.0.25/webservices" )> _
Public Class SecureService : Inherits WebService

Public AuthenticationHeader As AuthHeader

<WebMethod()> Public Function Login( username As String, password As
String ) As ServiceTicket

End Function

End Class

Public Class AuthHeader:Inherits SoapHeader
Public SessionKey As String
End Class

Public Class ServiceTicket:Inherits AuthHeader
Public IsAuthenticated As Boolean
Public SessionKey As String
Public Expiration As DateTime
End Class

Public Class TempClass1:Inherits ServiceTicket
Public TomsClass1Name As String
End Class
************************************************** **********************

My Web page is :
************************************************** *******************
<%@ Import Namespace="Services" %>

<Script runat="Server">

Sub Page_Load
Dim objSecureService As SecureService
Dim objServiceTicket As ServiceTicket
Dim objAuthHeader As AuthHeader
Dim objTempClass1 As TempClass1

objSecureService = New SecureService
objServiceTicket = Session( "ServiceTicket" )
objTempClass1 = new TempClass1

</Script>

<html>
<head><title>TestSecureService.aspx</title></head>
<body>

<asp:Label
id="lblLuckyNumber"
EnableViewState="False"
Runat="Server" />

</body>
</html>
************************************************** ********************

Why do I only get an error on TempClass1 and not on the others?

2) In my Web page I have:

<%@ Import Namespace="Services" %>

But I don't have Namespace Services. Is this an MS Namespace?

Thanks,

Tom

Apr 3 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.