【问题标题】:Acumatica "Unable determine proper company id for the request"Acumatica“无法为请求确定正确的公司 ID”
【发布时间】:2017-02-03 05:01:26
【问题描述】:

我正在编写与 Acumatica 的基于合同的 API 的集成,但我遇到了阻止我从 API 获取数据的问题。这是错误:

System.ServiceModel.FaultException

System.Web.Services.Protocols.SoapException:服务器无法 处理请求。 ---> PX.Data.PXUndefinedCompanyException: 无法 为请求确定正确的公司 ID。

这是我的 API 集成代码,它位于我的 API 控制器方法之一中:

public HttpResponseMessage Get()
{

    var binding = new System.ServiceModel.BasicHttpBinding()
    {
        AllowCookies = true
    };

    var address = new System.ServiceModel.EndpointAddress("http://acumaticasandbox.mydomain.com/MyCompany/entity/Default/5.30.001");

    using (DefaultSoapClient client = new DefaultSoapClient(binding, address))
    {
        client.Login("myuser", "mypassword", "MyCompany", null, null);

        Entity[] items = client.GetList(new SalesOrder(), false);

        client.Logout();

        return Request.CreateResponse(HttpStatusCode.OK, items);
    }
}

显然“mydomain”和“MyCompany”是我实际代码中的真实值。

无论我尝试了什么,我似乎都无法通过 client.Login 调用。任何建议表示赞赏。

我正在使用 Acumatica 端点版本 5.30.001 并使用 C# 作为集成代码。

【问题讨论】:

  • 从您的代码中,我认为您的代码适用于 5.30 版的 Acumatica,但究竟是哪一个?
  • 是的,我使用的是 5.30.001。我也用这个更新了这个问题。谢谢
  • 我不是要端点版本,而是要在登录屏幕底部找到的 acumatica 实例的版本(如果您在其上进行集成)
  • @samol518,好的,登录屏幕上显示它的版本是 5.30.2489

标签: acumatica


【解决方案1】:

不要在您的请求中使用“公司名称”,而是使用公司“登录名”。 您可以在系统->管理->探索->公司

中找到公司登录名

【讨论】:

  • 我想这可能是它。我有错误的公司名称(有一个额外的空间)。它现在告诉我无效的凭据。我是否使用与登录 Acumatica Cloud ERP 应用程序相同的凭据?或者我正在使用的公司是否有单独的凭据。
  • 或者我可以尝试输入正确的密码 :) 它有效。谢谢!
猜你喜欢
  • 2016-01-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-05-10
  • 2016-10-04
  • 2012-01-14
  • 1970-01-01
相关资源
最近更新 更多