I am defining a number of functions in my client, as an example
[OperationContract]
List<CustomObject> GetObject(string id);
When trying to call this function from my interface if I try:
List<CustomObject> result = cvs.GetObject(5);
I get an error, instead what I must do is CustomObject[] result = cvs.GetObject(5);
One other example is when I define a message:
[MessageContract]
public class TestRequest
{
[MessageBodyMember]
public Int64 Id;
[MessageBodyMember]
public int row;
}
and a function for my Interface:
[OperationContract]
ResponseMessage GetMessage(TestRequest req);
When I try to use this much in the same manner:
TestRequest req = new TestRequest();
req.Id = 2;
req.row = 1;
ResponseMessage resp = cvs.GetMessage(req);
I get the there is no overload for method that takes one argument
message.
Below is the relevant part of the reference file created by
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
ResponseMessage MyService.GetMessage(TestRequest request)
{
return base.Channel.GetMessage(request);
}
public string GetMessage(long Id, int row, out long Length, out string Message, out System.IO.MemoryStream ReportMemoryStream)
{
TestRequest inValue = new ResponseMessage();
inValue.Id = Id;
inValue.row= row;
ResponseMessage retVal = ((MyService)(this)).GetMessage(inValue);
Length = retVal.Length;
Message = retVal.Message;
ReportMemoryStream = retVal.ReportMemoryStream;
return retVal.FileName;
}
Why is this disconnect between client and wfc service happen, and how can I solve it.