WCF Service invalid with Silverlight
Posted
by Echilon
on Stack Overflow
See other posts from Stack Overflow
or by Echilon
Published on 2009-11-24T15:18:05Z
Indexed on
2010/04/06
22:13 UTC
Read the original article
Hit count: 343
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);
}
}
© Stack Overflow or respective owner