Ton*_*zer 2 api soap acumatica
我试图让一个简单的基于 Acumatica 合同的 SOAP API Get() 或 GetList() 调用工作,我得到的只是一个错误:
System.ServiceModel.FaultException: 'System.ArgumentNullException: 值不能为空。参数名称:型号
请参阅下面的代码。我首先尝试了 REST API,但无法解决不同的问题(我也可能会在另一篇文章中添加)。任何想法错误是指什么?
using (var soapClient = new ServiceReference1.DefaultSoapClient())
{
//Log in to Acumatica ERP
soapClient.Login
(
"admin",
"admin",
"Company",
null,
null
);
ServiceReference1.SalesOrder orderToFind = new
ServiceReference1.SalesOrder
{
CustomerID = new ServiceReference1.StringValue { Value = "2" },
OrderType = new ServiceReference1.StringValue { Value = "SO" },
OrderNbr = new ServiceReference1.StringValue { Value =
"SO001337" },
};
var getOrder = soapClient.Get(orderToFind);
var getOrders =
soapClient.GetList(orderToFind);
}
Run Code Online (Sandbox Code Playgroud)
Acumatica v17.204.0019。
刚刚遇到了同样的错误,有点惭愧地承认该解决方案对我来说似乎超级简单:allowCookies="true"
app.config 中缺少绑定
启用 cookie 后,出现错误ArgumentNullException:值不能为空。参数名称:模型得到解析:
<binding name="DefaultSoap" allowCookies="true" />
Run Code Online (Sandbox Code Playgroud)