C# 如何通过IIS 7.5上托管的RESTful WCF服务将数据从iPhone应用程序输入SQL数据库

C# 如何通过IIS 7.5上托管的RESTful WCF服务将数据从iPhone应用程序输入SQL数据库,c#,ios,sql,wcf,C#,Ios,Sql,Wcf,我创建了一个小项目,可以通过restfulwcf服务从iPhone读取数据并将数据插入sqlserver。 我已通过此链接中的以下方法成功读取数据: 因此,第二步是如何将数据从iPhone写入并插入sql server。为此,我首先创建了在Web服务中插入数据的方法: 在WCF接口中:(.cs) 实施中:(svc.cs) { } 因此,当我测试web服务时(localhost/JsonWcfService/GetEmployees.svc/json/InsertEmployee/myName/

我创建了一个小项目,可以通过restfulwcf服务从iPhone读取数据并将数据插入sqlserver。 我已通过此链接中的以下方法成功读取数据:

因此,第二步是如何将数据从iPhone写入并插入sql server。为此,我首先创建了在Web服务中插入数据的方法:

在WCF接口中:(.cs)

实施中:(svc.cs)

{

}

因此,当我测试web服务时(localhost/JsonWcfService/GetEmployees.svc/json/InsertEmployee/myName/MylastName/6565) 在浏览器上,我收到以下错误:未找到服务端点

有人能帮忙吗?如果可能的话,有人可以帮助使用xcode代码将数据发送到web服务吗?
谢谢

因为它的方法是POST,所以您可以使用以下插件测试您的Web服务

我不知道是否应该在web服务中更改.config文件中的某些内容我的问题是如何执行oposite操作,以及写入数据(在我的案例中添加员工{firstname,lastname,salary}在我的Microsoft sql server中,通过我创建的wcf restfull web服务从xcode运行,我很确定我的代码是正确的,但仍然找不到错误。。。
[OperationContract]
[WebInvoke(Method = "POST",
    ResponseFormat = WebMessageFormat.Json,
    RequestFormat = WebMessageFormat.Json,
    BodyStyle = WebMessageBodyStyle.Wrapped,
    UriTemplate = "json/InsertEmployee/{id1}/{id2}/{id3}")]
bool InsertEmployeeMethod(string id1,string id2, string id3);
  public bool InsertEmployeeMethod(string id1,string id2, string id3)
   int success = 0;

   using (SqlConnection conn = new SqlConnection("server=(local);database=EmpDB;Integrated Security=SSPI;"))
   {
       conn.Open();

       decimal value= Decimal.Parse(id3);
       string cmdStr = string.Format("INSERT INTO EmpInfo VALUES('{0}','{1}',{2})",id1,id2,value);
       SqlCommand cmd = new SqlCommand(cmdStr, conn);
       success = cmd.ExecuteNonQuery();

       conn.Close();
   }

   return (success != 0 ? true : false);