我正在开发一个 iOS 应用程序,它调用我使用 mono 编写的 Web 服务,并使用 apache 运行。但是,当我调用 web 方法时,接收到的参数始终为空,例如在此调用中(我使用 Appcelerator)
callparams = {
username: String(username),
password: String(password)
};
alert(String(username) + String(password));
try {
suds.invoke('Login', callparams, function(xmlDoc){
在服务器上,我有这个网络方法
[WebMethod]
public string Login(string username, string password)
{
return username + "-00";
}
当我运行模拟时,我只收到“-00”而不是用户名!为什么会这样?我也尝试过使用整数,但它们也是空的。
尽管如此,如果我使用该服务的测试表单,它会完美地工作..
我在 MacOX 10.7.2 上运行 mono 2.8.2 apache 2...
提前致谢
最佳答案
据我所知,您不能使用 fast-cgi-monoserver 或 mod_mono 下的单声道服务来做到这一点。使用 asmx(我们的 PageMethod)的替代方法,例如 ServiceStack .
关于ios - webmethod 在 ios 调用上接收空参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8084432/