The issue is when wcf service is sending the list of class objects to client, the values are null. Any help or guidance is appreciated.
My service interface is
IPswdService.cs
namespace GetPasswordsSvc
{
[ServiceContract]
public interface IPswdService
{
[OperationContract]
List<dbVal> GetData(int value);
}
[DataContract]
public class dbVal
{
public string Group;
public string Title;
public string Username;
} ;
}
GetPasswords.svc.cs
namespace GetPasswordsSvc
{
public class PswdService : IPswdService
{
public List<dbVal> GetData(int value)
{
List<dbVal> kpdata= (from entry in db.RootGroup.GetEntries(true)
select new dbVal
{
Group = entry.ParentGroup.Name,
Title = entry.Strings.ReadSafe("Title"),
Username = entry.Strings.ReadSafe("UserName"),
}).ToList();
List<dbVal> l = kpdata.ToList();
return l;
}
======================================
WCF Client code
SvcRef.PswdServiceClient wcfClient = new SvcRef.PswdServiceClient();
wcfClient.Open();
List<GetPasswords.dbVal> dbValues = wcfClient.GetData(0);
==============================================
The client config file is
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IPswdService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://xxxxxxx:444/GetPasswords.svc" binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IPswdService" contract="SvcRef.IPswdService"
name="BasicHttpBinding_IPswdService" />
</client>
</system.serviceModel>