代码之家  ›  专栏  ›  技术社区  ›  mxmissile

导入针灸分类时的通讯异常

  •  0
  • mxmissile  · 技术社区  · 7 年前

    正在尝试导入/设置 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

    分类详细信息 但是在针灸术中保存的是正确的。似乎Put正在进行更新,然后将实际类别从服务器返回给客户机。Acumatica中的类别包含数千个相关的税务记录。我不想要也不需要这个。我宁愿这是一场火灾,忘记最新情况。

    我可以 catch 异常并继续,但等待异常抛出的速度非常慢。我觉得我只是做错了什么。

    1 回复  |  直到 7 年前
        1
  •  1
  •   Hugues Beauséjour    7 年前

    返回的数据长度超过 绑定属性。

    <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
    
    推荐文章