简体   繁体   English

IBM Watson Discovery .Net AddDocument 问题

[英]IBM Watson Discovery .Net AddDocument problem

I'm getting an error when I try to add a large document to Watson Discovery using .Net SDK.当我尝试使用 .Net SDK 将大型文档添加到 Watson Discovery 时出现错误。 The problem ocurrs when the file is larger than 11MB.当文件大于 11MB 时会出现此问题。 I've tried to add the same document on more than one Environment and Collection.我尝试在多个环境和集合中添加相同的文档。 When the file is smaller than 11MB the code below works perfectly.当文件小于 11MB 时,下面的代码可以完美运行。

Code:代码:

        byte[] content = File.ReadAllBytes(@"D:\test\A17_FlightPlan.pdf");

        using (MemoryStream ms = new MemoryStream(content))
        {
            try
            {
                var document = discoveryService.AddDocument(
                    environmentid,
                    collectionid,
                    ms,
                    "A17_FlightPlan.pdf",
                    "application/pdf",
                    null);
            }
            catch (Exception ex)
            {
                Console.Write(ex.ToString());
            }
        }

Error: {"The API query failed with status code InternalServerError: INKApi Error | x-global-transaction-id: | error: "}错误:{“API 查询失败,状态码为 InternalServerError:INKApi 错误 | x-global-transaction-id:| 错误:”}

The problem was the internet proxy configured on the my develop machine.问题是我的开发机器上配置的互联网代理。 It must have some request size limitation.它必须有一些请求大小限制。 I've changed to another proxy and it worked.我已更改为另一个代理并且它起作用了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM