Wednesday 15 September 2010

How to add List<int> to a DataContract of a web service -


I want to create a data contact which is a class with 2 separate list members. When I try to start a web service, I get an error that my method, SendEmail, is not supported by Test WCF client. It is my data contract:

  [DataContract] [ Known type (type [int]]]] public class EmailInfo {personal string strFromUserID = string.Empty; Personal strings strFromAddress = string.Empty; Private strings strFromName = string.Empty; Private object lstIndividuals = null; Private object lstGroupIDs = null; Private strings strSubject = string.Empty; Private string strMessage = string.Empty; [Database] Public String UUSIRID {Receive {Return Strofro USIDID; } Set {strFromUserID = value; }} [Datamember] adress from public string {get {return strFromAddress; } Set {strFromAddress = value; }} [Datamember] public string fromName {get {return strFromName; } Set {strFromName = value; }} [Database] Public Object Personal ID {{Return LCTIIDID; } Set {lstIndividuals = value; }} [Datamember] Public Object GroupWise {get {return lstGroupIDs; } Set {lstGroupIDs = value; }} [Datamember] public string subject {get {return strSubject; } Set {strSubject = value; }} [Datamember] public string message {get {return strmessage; } Set {strMessage = value; }}}  

This is my method that uses data controls:

  public string SendEmail (EmailInfo emailInfo) {string tstrErrorMsg = string.Empty ; SqlConnection SqlConn = Faucet; Try {return tstrErrorMsg; } Hold (ex before) {return tap; } Finally {if (SqlConn! = Null) {SqlConn.Close (); }}}  

I have a datamember in the data-contract which is of type list. How do I add that type to a data content?

I found the web service to change lstIndividualIDs and to list the list groups, I thought I have to use the objects if someone else has this problem ...

Object lstIndividualIDs -> List list groupIdists with the same list allowed this test client to run the service.


No comments:

Post a Comment