Click here to Skip to main content
15,884,177 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all coders,

Below is my defined class in Iservice.vb file on WCF service :

VB
<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 :

VB
<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 :

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 :

VB
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 :

VB
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
Posted
Updated 10-Apr-14 0:33am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900