acumatica - 导入 Acumatica TaxCategory 时出现 CommunicationException
问题描述
尝试通过. Tax
_TaxCategory
TaxCategoryTaxDetail
var categoryDetails = new TaxCategoryTaxDetail
{
TaxID = new StringValue {Value = "MYTAXID"},
TaxCategory = new StringValue {Value = "TAXABLE"},
};
var category = new TaxCategory
{
TaxCategoryID = new StringValue {Value = "TAXABLE"},
Details = new[] {categoryDetails}
};
_client.Put(category);
调用Put
抛出:
The maximum message size quota for incoming messages (6553600) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.
端点版本:17.200.001 Acumatica 版本:18.107.0022 客户端应用程序在 Visual Studio 2017 中使用 wsdl 端点。
categoryDetails
与我正在使用的其他一些工作调用相比,有效负载很小。
categoryDetails
虽然正确保存在 Acumatica 中。似乎 Put 正在执行更新,然后将实际类别从服务器返回给客户端。Acumatica 中的类别包含数千条相关的税务记录。我不想要或不需要这个。我宁愿它是一场火灾而忘记更新。
我可以catch
抛出异常并继续,但是等待异常抛出的速度非常慢。我觉得我在这里做错了什么。
解决方案
返回的数据长度超过MaxReceivedMessageSize绑定属性。
您可以增加“app.config”文件中的限制:
<binding name="DefaultSoap" allowCookies="true" maxReceivedMessageSize="2147483647">
<security mode="Transport" />
</binding>
或直接在soap客户端构造函数中:
using (soapClient = new DefaultSoapClient(new BasicHttpBinding()
{
AllowCookies = true,
Name = "DefaultSoap",
MaxBufferSize = 2147483647,
MaxReceivedMessageSize = 2147483647,
Security = new BasicHttpSecurity() { Mode = BasicHttpSecurityMode.Transport }
},
new EndpointAddress(url)))
{
}
在 webservice 调用中,您还可以指定返回行为:
ReturnBehavior = ReturnBehavior.None
推荐阅读
- spring-boot - ZUUL 的所有微服务的集中式 Swagger 配置
- selenium - Selenium,在不同的循环中使用相同的驱动程序
- google-kubernetes-engine - 在 GKE 入口负载均衡器中公开 80/443 以外的端口?
- macos - 增加 catalina 上的共享内存大小
- python - 如何从python中的json读取字节?
- html - 使用 SVG 编码将鼠标悬停在 PNG 图像上时如何获得不同的颜色/填充/不透明度
- python - 轮廓的曲面图
- java - Java 在 x 时间段内调用 REST 服务,以定期间隔进行响应
- react-native - 试图在本机反应中将图像数据传递到另一个屏幕
- docusignapi - 调整 Docusign 的标志此处选项卡的大小