通过REST API连接到Azure DevOps失败
我目前正在研究REST API,以便能够通过IT调用WCF服务。现在,当我尝试使用此方法通过Azure DevOps调用任务时,我遇到了问题,
<OperationContract()>
<WebGet(UriTemplate:="/todos?user={sUser}&projectID={lProjektID}", BodyStyle:=WebMessageBodyStyle.Wrapped, RequestFormat:=WebMessageFormat.Json, ResponseFormat:=WebMessageFormat.Json)>
Function GetTodos(Optional ByVal sUser As String = "%", Optional ByVal lProjektID As Long = Nothing) As List(Of ProjektToDo)
在此尝试将其连接到Azure DevOps之后,我会在此处获得这些例外:
Dim creds As New VssBasicCredential(String.Empty, _DevOpsPAT)
Dim connection As VssConnection = New VssConnection(New Uri(My.Settings.TFSBasisUrlSSL), creds)
'Create instance of WorkItemTrackingHttpClient using VssConnection
Dim witClient As WorkItemTrackingHttpClient = connection.GetClient(Of WorkItemTrackingHttpClient) 'This connection fails !'
Dim queryHierarchyItems As List(Of QueryHierarchyItem) = witClient.GetQueriesAsync(Projekt,, 2).Result
- “ System.net.sockets.sockets.socketException in System.dll
- ” system.io 中。
-
-
-
- .http.httprequestexception“在mscorlib.dll中。
- ex.message的innerexception告诉我“现有连接是由远程主机关闭的”消息:“无法从传输连接中读取数据”。 我目前正在一家新公司培训,并且在REST API和WCF服务方面没有经验,请帮助我,我迫切希望这项任务,因为我只是不知道从哪里开始。
I am currently working on a REST API to be able to call a WCF service via it. Now I have the problem when I try to call up tasks via Azure DevOps using this method,
<OperationContract()>
<WebGet(UriTemplate:="/todos?user={sUser}&projectID={lProjektID}", BodyStyle:=WebMessageBodyStyle.Wrapped, RequestFormat:=WebMessageFormat.Json, ResponseFormat:=WebMessageFormat.Json)>
Function GetTodos(Optional ByVal sUser As String = "%", Optional ByVal lProjektID As Long = Nothing) As List(Of ProjektToDo)
I get these exceptions after trying to connect to Azure Devops at this:
Dim creds As New VssBasicCredential(String.Empty, _DevOpsPAT)
Dim connection As VssConnection = New VssConnection(New Uri(My.Settings.TFSBasisUrlSSL), creds)
'Create instance of WorkItemTrackingHttpClient using VssConnection
Dim witClient As WorkItemTrackingHttpClient = connection.GetClient(Of WorkItemTrackingHttpClient) 'This connection fails !'
Dim queryHierarchyItems As List(Of QueryHierarchyItem) = witClient.GetQueriesAsync(Projekt,, 2).Result
- "System.Net.Sockets.SocketException" in System.dll
- "System.IO.IOException" in System.dll
- "System.ObjectDisposedException" in System.dll
- "System.Net.WebException" in System.dll
- "System.Net.Http.HttpRequestException" in Microsoft.VisualStudio.Services.Common.dll
- "System.Net.Http.HttpRequestException" in mscorlib.dll.
- The InnerException of the ex.Message tells me "An existing connection was closed by the remote host" Message: "Unable to read data from the transfer connection".
I'm currently training in a new company and have no experience in the area of Rest API and WCF Service, please help me I'm desperate about this task because I just don't know where to start.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论