Hi all coders,
Below is my defined class in Iservice.vb file on WCF service :
<DataContract>
Public Class DenialDispute
<DataMember()>
Private _Age As Integer
<DataMember()>
Private _Flg As Integer
<DataMember()>
Private _PESysId As Integer
Public Sub New(Age As Integer, Flg As Integer, PESysId As Integer)
Me._Age = Age
Me._Flg = Flg
Me._PESysId = PESysId
End Sub
End Class
Below is operation contract for method which is returning list of defined class :
<OperationContract()>
Function GetDenialDispute(ByVal storeProcedure As String, ByVal clientId As String, ByVal UserId As String, ByVal recStatus As String) As List(Of DenialDispute)
Below is method in Service1.svc.vb :
Public Function GetDenialDispute(ByVal storeProcedure As String, ByVal clientId As String, ByVal UserId As String, ByVal recStatus As String) As List(Of DenialDispute) Implements IService1.GetDenialDispute
Return cls.GetDenialDispute(storeProcedure, clientId, UserId, recStatus)
End Function
Below is my function where actually store procedure is executing :
Public Function GetDenialDispute(ByVal storeProcedure As String, ByVal clientId As String, ByVal UserId As String, ByVal recStatus As String) As List(Of DenialDispute)
Dim lstDenialDispute As List(Of DenialDispute) = New List(Of DenialDispute)()
Using connection As New SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings("constr").ConnectionString)
Using command As New SqlCommand(storeProcedure, connection)
command.CommandType = CommandType.StoredProcedure
connection.Open()
command.Parameters.AddWithValue("@ClientSysID", clientId)
command.Parameters.AddWithValue("@UserID", UserId)
command.Parameters.AddWithValue("@RecStatus", recStatus)
Using reader = command.ExecuteReader()
While reader.Read()
lstDenialDispute.Add(New DenialDispute(reader("Age").ToString(), reader("Flg").ToString(), reader("PE").ToString()))
End While
End Using
End Using
End Using
Return lstDenialDispute
End Function
now come at client side i have coded below sentence which is calling above WCF function :
Dim listDenialDispute As List(Of ServiceReferenceTest.DenialDispute) = New List(Of ServiceReferenceTest.DenialDispute)(cntTest.GetDenialDispute("storeprocedure", "client","user", "1"))
so after calling that method WCF returning below list with correct properties like "_Age","_Flg" and "PeSysID"
but on client side i am getting "_Age","_AgeField","_AgeFieldSpecified","_AgeFieldSpecified"
can you suggest on why WCF added "_AgeField","_AgeFieldSpecified","_AgeFieldSpecified" automatically ???
Thanks in advance