webmethod 在 ios 调用上接收空参数
我正在开发一个 iOS 应用程序,它调用我使用 mono 编写的 Web 服务,并使用 apache 运行。但是,当我调用 webmethod 时,收到的参数始终为空,例如在此调用中(我使用 Appcelerator)
callparams = {
username: String(username),
password: String(password)
};
alert(String(username) + String(password));
try {
suds.invoke('Login', callparams, function(xmlDoc){
在服务器上,我有此 webmethod
[WebMethod]
public string Login(string username, string password)
{
return username + "-00";
}
当我运行模拟时,我只收到“-00”而不是用户名!为什么会发生这种情况?我也尝试过使用整数,它们也为空。
尽管如此,如果我使用服务的测试形式,这会完美地工作。
我在 MacOX 10.7.2 上运行 mono 2.8.2 apache 2...
提前致谢
I'm developing an iOS app and it calls a Web service I wrote using mono and it runs using apache. However, when I call the webmethod, the parameters received are always null for example in this call (im using Appcelerator)
callparams = {
username: String(username),
password: String(password)
};
alert(String(username) + String(password));
try {
suds.invoke('Login', callparams, function(xmlDoc){
On the server, i have this webmethod
[WebMethod]
public string Login(string username, string password)
{
return username + "-00";
}
When I run the simmulation, i only receive "-00" and not the username! why is this happening? I've also tried with integers and they're null too..
Nonetheless this works perfectly if i use the test form of the service..
Im running on MacOX 10.7.2 with mono 2.8.2 apache 2...
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,您不能在 fast-cgi-monoserver 或 mod_mono 下使用单声道服务来执行此操作。使用 asmx(我们的 PageMethod)的替代方案,例如 ServiceStack。
As far I know you can not do this with mono services under fast-cgi-monoserver ou mod_mono. Use an alternative to asmx (our PageMethod) like ServiceStack.