webmethod 在 ios 调用上接收空参数

发布于 2024-12-15 03:08:38 字数 674 浏览 4 评论 0原文

我正在开发一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浮华 2024-12-22 03:08:39

据我所知,您不能在 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文