Web Service doesn't return needed values

A

AlBruAn

I'm having to use a Web Service to populate a control via JavaScript, but I
can't quite seem to get the Web Service to return the needed values. My web
method is as follows:

<WebMethod()> _
Public Function RetrieveAvailableTemplateFields(ByVal entityTypeID As
Integer, _
ByVal processID As Integer) As AvailableFields()

Return AvailableFields.RetrieveFieldNames(entityTypeID, processID)

End Function

The class containing the function it calls is defined as follows:

<Serializable()> _
Public Class AvailableFields

Private _FieldName As String
Private _FieldTag As String 'essentially the same as FieldName

Private Shared _ConnString As String = _
ConfigurationManager.ConnectionStrings("FROMain").ConnectionString

Public ReadOnly Property FieldName() As String
Get
Return _FieldName
End Get
End Property

Public ReadOnly Property FieldTag() As String
Get
Return _FieldTag
End Get
End Property

Public Sub New()

End Sub

Public Sub New(ByVal fieldName As String, ByVal fieldTag As String)
_FieldName = fieldName
_FieldTag = fieldTag
End Sub

Public Shared Function RetrieveFieldNames(ByVal entityTypeID As Integer,
ByVal processID As Integer)
Dim fieldList As New Generic.List(Of AvailableFields)
Dim info As New AvailableFields()

Dim dr As SqlDataReader = SqlDataAccess.ExecuteReader(_ConnString, _
"Outbound.RetrieveTemplateFieldsByEntityTypeAndProcessIDs", _
entityTypeID, processID)

While dr.Read()
info = New AvailableFields(dr("FieldName"), dr("FieldTag"))
fieldList.Add(info)
End While

If dr IsNot Nothing Then
dr.Close()
End If

Return fieldList.ToArray()

End Function
End Class


When I try invoking the Web Service, I get the following XML returned:

<?xml version="1.0" encoding="utf-8" ?>
- <ArrayOfAvailableFields
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://yourname.com/">
<AvailableFields />
<AvailableFields />
<AvailableFields />
<AvailableFields />
<AvailableFields />
<AvailableFields />
</ArrayOfAvailableFields>


What am I doing wrong that's keeping me from getting back the names and tags
of the available fields?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
44,998
Latest member
MarissaEub

Latest Threads

Top