小编Aru*_*nan的帖子

我的web api只从ajax客户端发出net :: ERR_CONNECTION_RESET错误

我的web api在几个IIS中工作,当移动到Azure VM时,它只在从ajax客户端调用时提供net :: ERR_CONNECTION_RESET,但在使用POSTMAN时工作正常.

当从ajax html客户端命中时,它在OPTIONS请求中显示net :: ERR_CONNECTION_RESET.认为它没有到达服务器,但在引用http错误文件时

C:\ WINDOWS\SYSTEM32\LogFiles文件\ HTTPERR

表明

2017-07-20 12:54:06 210.18.173.26 54141 10.0.1.4 80 HTTP/1.1 OPTIONS/api/User/Method1 - 1 Request_Cancelled myappapipool

在web.config中

 <add name="Access-Control-Allow-Origin" value="*" />
 <add name="Access-Control-Allow-Headers" value="Content-Type" />
 <add name="Access-Control-Allow-Credentials" value="true" />
 <add name="Access-Control-Allow-Methods" value="GET, POST, OPTIONS" />
Run Code Online (Sandbox Code Playgroud)

我试过在web.config中添加超时,但它没有解决.还尝试将Web配置"Access-Control-Allow-Headers"值更改为"*",它给出了预检请求错误.

由于相同的服务器和ajax客户端通信在其他iis中工作,我怀疑在IIS中配置我的web api时,我遗漏了一些可疑的东西,它位于Azure VM中.从POSTMAN或Android客户端调用时,它就像一个带有IIS中现有配置的魅力.

任何帮助/建议都非常感谢.

c# iis azure asp.net-web-api postman

6
推荐指数
1
解决办法
4649
查看次数

错误:在 WebhookClient.handleRequest 处没有请求意图的处理程序

调用云函数的默认意图给出错误

Error: No handler for requested intent
at WebhookClient.handleRequest (/user_code/node_modules/dialogflow-fulfillment/src/dialogflow-fulfillment.js:287:29)
at exports.dialogflowFirebaseFulfillment.functions.https.onRequest (/user_code/index.js:73:11)
at cloudFunction (/user_code/node_modules/firebase-functions/lib/providers/https.js:57:9)
at /var/tmp/worker/worker.js:783:7
at /var/tmp/worker/worker.js:766:11
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickDomainCallback (internal/process/next_tick.js:128:9)
Run Code Online (Sandbox Code Playgroud)

因为我在诊断信息日志中的网络响应显示了这一点。

             {
              "responseId": "86043a10-8bc2-4ee7-8e8b-1e997289ad7c",
              "queryResult": {
                "queryText": "hi",
                "action": "input.welcome",
                "parameters": {},
                "allRequiredParamsPresent": true,
                "fulfillmentText": "Hi. Am Uma. Kindly let me know your experience facing an issue.",
                "fulfillmentMessages": [
                  {
                    "text": {
                      "text": [
                        "Hi. Am Uma and welcome to support. Kindly let me know your experience facing an issue."
                      ]
                    }
                  }
                ], …
Run Code Online (Sandbox Code Playgroud)

google-cloud-functions actions-on-google dialogflow-es

6
推荐指数
1
解决办法
3060
查看次数

无法将"System.Byte"类型的对象强制转换为"System.String"类型

在通过过滤将Datatable转换为Dataview时,查询我的SQL数据库以获取数据到Dataset,因为作为Linq的新手,我收到了基本的转换错误.

码:

DataView cktDv = (from clounceform in dsclounceForms.Tables["Table2"].AsEnumerable()
                                         where clounceform.Field<string>("Form_FileType_ID").Equals("5")
                                         select clounceform).CopyToDataTable().AsDataView();
Run Code Online (Sandbox Code Playgroud)

例外是

Unable to cast object of type 'System.Byte' to type 'System.String'.
System.Data.DataSetExtensions
at System.Data.DataRowExtensions.UnboxT`1.ReferenceField(Object value)
at System.Data.DataRowExtensions.Field[T](DataRow row, String columnName)
at ClounceFormsSuite.Design.CreateFormDesign.<>c.<CreateForm>b__12_0(DataRow bounceform) in myprojectfolderpath\CreateFormDesign.xaml.cs:line 115
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
at System.Data.DataTableExtensions.LoadTableFromEnumerable[T](IEnumerable`1 source, DataTable table, Nullable`1 options, FillErrorEventHandler errorHandler)
at System.Data.DataTableExtensions.CopyToDataTable[T](IEnumerable`1 source)
at ClounceFormsSuite.Design.CreateFormDesign.CreateForm(String[] cktFileContent, String filePath, String formID) in myprojectfolderpath\CreateFormDesign.xaml.cs:line 114
at ClounceFormsSuite.Design.CreateFormDesign.UserControl_Loaded(Object sender, RoutedEventArgs e) in myprojectfolderpath\CreateFormDesign.xaml.cs:line 70
Run Code Online (Sandbox Code Playgroud)

我无法继续进行我实际上将字符串转换为int并给出了不同的错误,这会误导我更多当尝试转换为int时

DataView cktDataView = (from clounceform in dsclounceForms.Tables["Table2"].AsEnumerable()
                                         where …
Run Code Online (Sandbox Code Playgroud)

c# linq wpf linq-to-dataset

0
推荐指数
1
解决办法
2291
查看次数