登录jirasoap api [英] Login to jira soap api

查看:32
本文介绍了登录jirasoap api的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在 c# 上使用 jira soap api:

I try use jira soap api on c#:

  1. 在 VS2010 中创建新项目
  2. 添加网络服务参考(JiraTest):http://jira.atlassian.com/rpc/soap/jirasoapservice-v2?wsdl
  3. 写下一个代码:

  1. create new project in VS2010
  2. add web service reference (JiraTest): http://jira.atlassian.com/rpc/soap/jirasoapservice-v2?wsdl
  3. write next code:

static void Main(string[] args)
{
    var jiraLogin = "soaptester";
    var jiraPassword = "soaptester";
    var jiraClient = new JiraTest.JiraSoapServiceClient();
    var projects = jiraClient.getProjects();
}

但是这段代码抛出了我尚未验证的异常.我尝试找到 login 方法,但它有下一个签名:

But this code throw exepition that I'm not autentificate yet. I try find login method, but it have next signature:

public void login();

哪里没有登录名和密码参数.当我使用此登录方法时,代码抛出登录名或密码无效的异常.而且我不知道我必须在哪里设置我的凭据.

Where are no loginname and password parameters. When I use this login method code throw exeption that login or password invalid. And I don't known where I must set my credentials.

如何在调用所需方法之前使用 jira soap api 登录?

How I can login with jira soap api before call needed method?

添加:见https://developer.atlassian.com/display/JIRADEV/Creating+a+JIRA+SOAP+Client

推荐答案

你可以试试这个

    JiraSoapServiceService jiraSoapService = new JiraSoapServiceService();

    public string Login(string user, string pwd)
    {
        string result = string.Empty;

        result = jiraSoapService.login(user, pwd);

        return result;

    }


    public void Logout(string token)
    {
        jiraSoapService.logout(token);
    }

这篇关于登录jirasoap api的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆