Пример #1
0
        public static string Authenticate(this JiraSoapServiceClient client, Context context)
        {
            Argument.IsNotNull(() => client);
            Argument.IsNotNull(() => context);

            return(client.login(context.UserName, context.Password));
        }
Пример #2
0
 private void button1_Click(object sender, RoutedEventArgs e)
 {
     var c = new JiraSoapServiceClient("jirasoapservice-v2");
     try
     {
         Token = c.login(Username.Text, Password.Text);
         User = Username.Text;
         DialogResult = true;
         Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Пример #3
0
        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            var login = new Login();
            login.ShowDialog();

            _token = login.Token;
            _username = login.User;
            _client = new JiraSoapServiceClient("jirasoapservice-v2");

            _projects = _client.getProjectsNoSchemes(_token).ToList();

            Project.ItemsSource = _projects;
            Project.SelectedIndex = 0;

            IssueType.ItemsSource = _issueTypes;
            UpdateIssueTypes();
        }
        /// <summary>
        /// Creates and configures a JiraSoapServiceClient
        /// </summary>
        /// <param name="jiraBaseUrl">Base url to JIRA server</param>
        /// <returns>JiraSoapServiceClient</returns>
        public static JiraSoapServiceClient Create(string jiraBaseUrl)
        {
            if (!jiraBaseUrl.EndsWith("/"))
            {
                jiraBaseUrl += "/";
            }

            var endPointUri = new Uri(jiraBaseUrl + "rpc/soap/jirasoapservice-v2");

            BasicHttpBinding binding = null;

            if (endPointUri.Scheme == "https")
            {
                binding = new BasicHttpBinding(BasicHttpSecurityMode.Transport);
            }
            else
            {
                binding = new BasicHttpBinding(BasicHttpSecurityMode.None);
            }
            binding.TransferMode           = TransferMode.Buffered;
            binding.UseDefaultWebProxy     = true;
            binding.MaxReceivedMessageSize = int.MaxValue;
            binding.SendTimeout            = new TimeSpan(0, 10, 0);
            binding.ReceiveTimeout         = new TimeSpan(0, 10, 0);
            binding.ReaderQuotas           = new XmlDictionaryReaderQuotas()
            {
                MaxStringContentLength = int.MaxValue,
                MaxNameTableCharCount  = int.MaxValue,
            };
            binding.Security.Message.ClientCredentialType = BasicHttpMessageCredentialType.UserName;

            var endpoint = new EndpointAddress(endPointUri);
            var jiraSoapServiceClient = new JiraSoapServiceClient(binding, endpoint);

            jiraSoapServiceClient.Endpoint.Behaviors.Add(new RemoteWorklogPatchBehavior());

            return(jiraSoapServiceClient);
        }
Пример #5
0
 public JiraSoapServiceClientWrapper(string jiraBaseUrl)
 {
     _client = JiraSoapServiceClientFactory.Create(jiraBaseUrl);
     _url    = jiraBaseUrl.EndsWith("/") ? jiraBaseUrl : jiraBaseUrl += "/";
 }