我开发了我的第一个 WCF 服务,我想使用邮递员进行测试,但我不断收到 404 not found 错误。我使用 WCFClient 对其进行了测试,它工作正常。我的模特
[DataContract]
public class chatbotModel
{
[DataMember]
public System.Guid id { get; set; }
[DataMember]
public string subject { get; set; }
[DataMember]
public Nullable<System.DateTime> date_started { get; set; }
}
我的功能:
public bool InsertChatBotData(chatbotModel model)
{
using (var chatBotContext = new regacrmEntities())
{
var id = Guid.NewGuid();
var NewchatBot = new a01_chatbot()
{
id = id,
date_entered = model.date_started,
date_modified = model.date_ended,
name = model.subject,
description = model.description
};
chatBotContext.a01_chatbot.Add(NewchatBot);
chatBotContext.SaveChanges();
return true;
}
}
[ServiceContract]
public interface ICrmService
{
[OperationContract]
[WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Xml, UriTemplate = "InsertChatBotData")]
bool InsertChatBotData(chatbotModel model);
}
SOAPAction:http ://tempuri.org/ICrmService/InsertChatBotData