【问题标题】:Mono. Web API Service is returning 0 - when invoking form outside单核细胞增多症。 Web API 服务返回 0 - 在外部调用表单时
【发布时间】:2014-11-11 08:04:04
【问题描述】:

我的 Web API 服务在带有 Mono 和 Nginx 的 Linux Ubuntu 上运行。

当我从 localhost 测试我的 API 时,它可以完美运行并将每个请求写入日志文件,但如果我从外部环境(从其他 IP)调用方法,则响应是:

The web service returned the following result: 0 -

它也没有写任何错误日志,所以我可以调查问题。

这是我的方法:

[WebMethod]
public string Test(string strXML)
{
    string strMessage = "";
    XmlDocument xdoc = new XmlDocument();
    try
    {
        xdoc.LoadXml(strXML);

        XmlNode xContent = xdoc.GetElementsByTagName("content")[0];
        strMessage = xContent.InnerText;
    }
    catch (Exception ex)
    {

    }

    return strMessage;
}

你有什么建议?

【问题讨论】:

    标签: c# web-services nginx mono


    【解决方案1】:

    试试这个帖子中 marc.d 的答案:

    Connection refused when calling SOAP Webservice using Android

    这对我有帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-09-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多