Login to jira soap api

和自甴很熟 提交于 2019-11-30 21:28:06

You can try this

    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);
    }

I had the same problem and found the answer. You need to add it as a Web Reference. It will bring in the parameters but as they appear in the WSDL so login(string username, string password) become login(string in0, string in1) but atleast it's usable.

So steps:

  • Right-click Project and click "Add Service References..." (just like before)
  • Click "Advanced..." in the bottom left of the dialog
  • Click "Add Web Reference..." in the bottom left of the dialog
  • Enter the WSDL Url in the Url Box for example "https://jira.atlassian.com/rpc/soap/jirasoapservice-v2?WSDL"
  • Click the green go arrow
  • Name your reference in the Web reference name: box
  • Click "Add Reference"

I found myself in the same situation but could not go with the 'Web Service Service' solution as I needed to control the binding configuration (sendTimeout, maxReceivedMessageSize etc).

You can solve this by manually generating the JIRA WCF proxy via svcutil.exe. For instance:

 1. Run svcutil.exe http://myhostname/rpc/soap/jirasoapservice-v2?wsdl /n:*,mynamespace
 2. Copy output source file to your project
 3. Copy configuration (output.config) to your app.config.
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!