DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Fri, 17 Aug 2007 09:06:01 -0700,    posted on: microsoft.public.dotnet.framework.aspnet.webservices        back       

Thread Index
  1    AlBruAn .(donotspam)


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:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us