WCF Service invalid with Silverlight
- by Echilon
I'm trying to get WCF working with Silverlight. I'm a total beginner to WCF but have written asmx services in the past. For some reason when I uncomment more than one method in my service Silverlight refuses to let me use it, saying it is invalid. My code is below if anyone could help. I'm using the Entity Framework if that makes a difference.
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class MessageService {//: IMessageService {
/// <summary>
/// Sends a new message.
/// </summary>
/// <param name="recipientUsername">The recipient username.</param>
/// <param name="subject">The subject.</param>
/// <param name="messageBody">The message body.</param>
[OperationContract]
public void SendMessageByDetails(string recipientUsername, string subject, string messageBody) {
MessageDAL.SendMessage(recipientUsername, subject, messageBody);
}
/// <summary>
/// Sends a new message.
/// </summary>
/// <param name="msg">The message to send.</param>
[OperationContract]
public void SendMessage(Message msg) {
MessageDAL.SendMessage(msg);
}
}