我创建了一个如下所示的宁静网络服务
运营合同
[WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped,ResponseFormat = WebMessageFormat.Json, UriTemplate = "/PushNotification")]
[OperationContract]
void PushNotification(MailInformation mailInformations);
邮件信息类
[DataContract]
public class MailInformation
{
[DataMember]
public List<string> To { get; set; }
[DataMember]
public string SenderEmail { get; set; }
[DataMember]
public string Subject { get; set; }
}
如何使用 HttpWebrequest 调用此服务?
我的服务网址
localhost/Chat/ChatService.svc/PushNotification