Web Service doesn't return needed values
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?
Date:Fri, 17 Aug 2007 09:06:01 -0700
Author:
|