【发布时间】: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