troubleshooting Question

ASP.NET Web Service VB

Avatar of AsystData
AsystData asked on
Visual Basic.NETWCF
11 Comments1 Solution643 ViewsLast Modified:
Hey everyone running into a problem here. I have a webservice written in vb. First, I created my service already and have my default.aspx page calling the webservice without any issues. The web service goes through everything just fine and I can return my 'Arraylist".

My default.aspx page passes two parameters ("emailAddress" and "Password"). I go through all the checks and finally need to pass back two values ("UserId", and "1") if they can login and continue.

Here is the problem when I try to return the values to a label field it gives me "System.Object[]" Below is my code to show my webservice and default.aspx.vb code behind. Can anyone possibly point out what I am missing here?

'*********** START OF WEBSERVICE *******************
Imports System.Web.Services
Imports System.Web.UI
Imports System.Web.Services.Protocols
Imports System.ComponentModel
Imports AsystWebService.WebUtils
Imports System.IO
Imports System.Data
Imports System.Data.OleDb
Imports System.Data.Odbc
Imports System.Xml.Serialization
Imports System.Xml.Serialization.XmlSerializationWriter
Imports System.Collections.Generic

' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
' <System.Web.Script.Services.ScriptService()> _
<System.Web.Services.WebService(Namespace:="http://www.abc.net", Description:="ABC Login Service", Name:="ABC Login Service")> _
<System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<ToolboxItem(False)> _
Public Class BoardService

    Inherits System.Web.Services.WebService
    Dim oHomeowner As clsHomeowner
    Dim oNonHomeowner As clsNonHomeowner
    Dim oStrW As New StringWriter()
    Dim sXML As String


    <WebMethod()> _
    Public Function GetandCheckBoardMemberLogin(ByVal sEmailAddress As String, ByVal sPassword As String) As ArrayList

        Try
            Dim sErrMsg As String = ""

            InitDBConnection()

            Dim nHomeownerUserID As Integer = 0
            Dim nNonHomeownerUserID As Integer = 0
            Dim nCollectorID As Integer = 0
            Dim isAHomeowner As Boolean = False
            Dim isANonHomeowner As Boolean = False
            Dim sUserType As String
            Dim iUserID As Integer

            Dim BoardItems As New ArrayList()

            Dim s As String
            Dim n As Integer
            Dim oHomeowner As New clsHomeowner(sEmailAddress.Trim, sPassword.Trim, nHomeownerUserID, s, n, n, s, n)
           
           
            Dim oNonHomeowner As New clsNonHomeowner(sEmailAddress.Trim, sPassword.Trim, nNonHomeownerUserID, nCollectorID, sUserType)
           
            Dim sStatus As String = ""

            If oHomeowner.bIsHomeowner Then
                isAHomeowner = True
                sStatus &= "You are a homeowner - you're permissions are all Good."
            Else
                sStatus &= "You are not a homeowner - you have a USERID , but not in the Owners tables."
            End If

            If oNonHomeowner.bIsANonHomeowner Then
                isANonHomeowner = True
                sStatus &= vbCrLf & "You are a Non-homeowner.  Your Acct Type is " & PrepString(oNonHomeowner.sUsrAcctType) & " - you're in Weblogin, Security Users, etc.."
            Else
                sStatus &= vbCrLf & "You are not a Non-homeowner - you're in Weblogin, but not in Security Users."
            End If


            If isAHomeowner And isANonHomeowner Then

                iUserID = nHomeownerUserID
                BoardItems.Add(Convert.ToString(iUserID))

                Dim isNonhomewner As String
                If isANonHomeowner = True Then
                    isNonhomewner = 1
                Else
                    isNonhomewner = 0
                End If
                BoardItems.Add(Convert.ToString(isNonhomewner))

                Return BoardItems

            End If

        Catch ex As Exception

        End Try
    End Function

End Class

'*********** END OF WEBSERVICE *******************

'*********** START OF DEFAULT.ASPX CODE BEHIND *******************
Imports System.Web.Services
Imports System.Web.UI
Imports System.Web.Services.Protocols
Imports System.ComponentModel
Imports System.IO
Imports System.Data
Imports System.Data.OleDb
Imports System.Data.Odbc
Imports System.Xml.Serialization
Imports System.Xml.Serialization.XmlSerializationWriter
Imports System.Collections.Generic

Imports rfBoardService
Imports System.Xml

Partial Class _Default
    Inherits System.Web.UI.Page

    

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim myBoardService As New rfBoardService.BoardLoginService
       
        Dim sGetEmail As String = Me.txtEmail.Text
        Dim sGetPassword As String = Me.txtPassword.Text

        Label2.Text = myBoardService.GetandCheckBoardMemberLogin(sGetEmail, sGetPassword).ToString



    End Sub
End Class

'*********** END OF DEFAULT.ASPX CODE BEHIND *******************
ASKER CERTIFIED SOLUTION
gamarrojgq

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 11 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 11 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros