Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira .NET SDK Client

fatkullin_rustam
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 19, 2020

Hello

I have troubles with Jira SDK for .Net Core

I try to use oauth authorization to call Jira methods.

Unfortunetly I didn't find examples for .net core in official repository examples .

For testing purposes I have downloaded python example and had access token and token secret. Passed it to Jira SDK client

JiraSdkTokenTest - Microsoft Visual Studio 2020-02.png

But client throw exception

Unhandled Exception: System.AggregateException: One or more errors occurred. (Data at the root level is invalid. Line 1, position 1.) ---> System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.LoadXml(String xml)
at RestSharp.Extensions.RSACryptoServiceProviderExtensions.FromXmlStringImpl(RSACryptoServiceProvider rsa, String xmlString)
at RestSharp.Authenticators.OAuth.OAuthTools.<GetSignature>g__GetRsaSignature|23_0(<>c__DisplayClass23_0& )
at RestSharp.Authenticators.OAuth.OAuthTools.GetSignature(OAuthSignatureMethod signatureMethod, OAuthSignatureTreatment signatureTreatment, String signatureBase, String consumerSecret, String tokenSecret)
at RestSharp.Authenticators.OAuth.OAuthWorkflow.BuildProtectedResourceSignature(String method, WebPairCollection parameters, String url)
at RestSharp.Authenticators.OAuth1Authenticator.AddOAuthData(IRestClient client, IRestRequest request, OAuthWorkflow workflow)
at RestSharp.RestClient.ExecuteAsync(IRestRequest request, Action`2 callback, String httpMethod, Func`4 getWebRequest)
at RestSharp.RestClient.ExecuteAsync(IRestRequest request, Action`2 callback, Method httpMethod)
at RestSharp.RestClient.ExecuteAsync(IRestRequest request, CancellationToken token)
--- End of stack trace from previous location where exception was thrown ---
at Atlassian.Jira.Remote.JiraRestClient.ExecuteRequestAsync(Method method, String resource, Object requestBody, CancellationToken token)
at Atlassian.Jira.Remote.IssueService.GetIssueAsync(String issueKey, CancellationToken token)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at JiraSdkTokenTest.Program.Main(String[] args) in C:\Users\User\source\repos\JiraSdkTokenTest\JiraSdkTokenTest\Program.cs:line 35

Does anybody know how i can fix it?

 

 

 

0 answers

Suggest an answer

Log in or Sign up to answer