Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CommonRequest iot.cn-shenzhen.aliyuncs.com The operation has timed out. #392

Open
L60008028 opened this issue Dec 21, 2020 · 1 comment
Open

Comments

@L60008028
Copy link

硬件环境:==========================================
Linux raspberrypi 5.4.72-v7l+ #1356 SMP Thu Oct 22 13:57:51 BST 2020 armv7l GNU/Linux
donet环境:=====================================
root@raspberrypi:/home/pi/ali_iot_service# dotnet --info
.NET SDK (反映任何 global.json):
Version: 5.0.101
Commit: d05174dc5a

运行时环境:=====================================
OS Name: raspbian
OS Version: 10
OS Platform: Linux
RID: linux-arm
Base Path: /root/dotnet/sdk/5.0.101/

Host (useful for support):
Version: 5.0.1
Commit: b02e13abab

.NET SDKs installed:
3.1.403 [/root/dotnet/sdk]
5.0.101 [/root/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 3.1.9 [/root/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.1 [/root/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.9 [/root/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.1 [/root/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download

引用的SDK:aliyun-net-sdk-iot
代码:=====================================
public void TestQueryProductList()
{

		QueryProductListRequest request = new QueryProductListRequest();
		request.CurrentPage = 1;
		request.PageSize = 10;
		request.IotInstanceId = IotInstanceId;
		request.SetProductDomain(Domain);
		QueryProductListResponse response = _client.GetAcsResponse(request);
		Console.WriteLine(response.Success);
		Console.WriteLine(response.ErrorMessage);
		Console.WriteLine(response.Code);

		QueryProductListResponse.QueryProductList_Data data = response.Data;

		Console.WriteLine(data.CurrentPage);
		Console.WriteLine(data.PageSize);
		Console.WriteLine(data.PageCount);
		Console.WriteLine(data.Total);

		List<QueryProductListResponse.QueryProductList_Data.QueryProductList_ProductInfo> productList = data.List;
		Console.WriteLine(productList.Count);
	}

异常:=====================================
Unhandled exception. Aliyun.Acs.Core.Exceptions.ClientException: SDK.WebException : HttpWebRequest WebException occured, the request url is iot.cn-shenzhen.aliyuncs.com System.Net.WebException: The operation has timed out.
at System.Net.HttpWebRequest.GetResponse()
at Aliyun.Acs.Core.Http.HttpResponse.GetResponse(HttpRequest request, Nullable1 timeout) at Aliyun.Acs.Core.DefaultAcsClient.DoAction[T](AcsRequest1 request, Boolean autoRetry, Int32 maxRetryNumber, String regionId, AlibabaCloudCredentials credentials, Signer signer, Nullable1 format, List1 endpoints)
at Aliyun.Acs.Core.DefaultAcsClient.DoAction[T](AcsRequest1 request, Boolean autoRetry, Int32 maxRetryNumber, IClientProfile profile) at Aliyun.Acs.Core.DefaultAcsClient.DoAction[T](AcsRequest1 request)
at Aliyun.Acs.Core.DefaultAcsClient.GetAcsResponse[T](AcsRequest`1 request)
at ALI_IOT_SERVICE.IotCloudAPI.TestQueryProductList() in E:\D\C#\ALI_IOT_SERVICE\IotCloudAPI.cs:line 55
at ALI_IOT_SERVICE.Program.Main(String[] args) in E:\D\C#\ALI_IOT_SERVICE\Program.cs:line 46

@WELL-E
Copy link

WELL-E commented Dec 31, 2020

同样的问题:

win10+vs2019
aliyun-net-sdk-iot v7.7.0

Iot SDK for .NET Samples!
SDK.WebException
HttpWebRequest WebException occured, the request url is iot.aliyuncs.com System.Net.WebException: The operation has timed out.
at System.Net.HttpWebRequest.GetResponse()
at Aliyun.Acs.Core.Http.HttpResponse.GetResponse(HttpRequest request, Nullable`1 timeout)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants