mirror of
https://github.com/greenshot/greenshot
synced 2025-08-21 14:03:23 -07:00
Fixed issue when the WSDL isn't in the URL
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2298 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
1e6a5de79b
commit
84e5e86751
1 changed files with 15 additions and 3 deletions
|
@ -109,6 +109,7 @@ namespace Jira {
|
||||||
private string url;
|
private string url;
|
||||||
private Cache<string, JiraIssue> jiraCache = new Cache<string, JiraIssue>(60 * config.Timeout);
|
private Cache<string, JiraIssue> jiraCache = new Cache<string, JiraIssue>(60 * config.Timeout);
|
||||||
private Cache<string, RemoteUser> userCache = new Cache<string, RemoteUser>(60 * config.Timeout);
|
private Cache<string, RemoteUser> userCache = new Cache<string, RemoteUser>(60 * config.Timeout);
|
||||||
|
private bool suppressBackgroundForm = false;
|
||||||
|
|
||||||
public JiraConnector() : this(false) {
|
public JiraConnector() : this(false) {
|
||||||
}
|
}
|
||||||
|
@ -116,6 +117,11 @@ namespace Jira {
|
||||||
public JiraConnector(bool suppressBackgroundForm) {
|
public JiraConnector(bool suppressBackgroundForm) {
|
||||||
this.url = config.Url;
|
this.url = config.Url;
|
||||||
this.timeout = config.Timeout;
|
this.timeout = config.Timeout;
|
||||||
|
this.suppressBackgroundForm = suppressBackgroundForm;
|
||||||
|
createService();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createService() {
|
||||||
if (!suppressBackgroundForm) {
|
if (!suppressBackgroundForm) {
|
||||||
new PleaseWaitForm().ShowAndWait(JiraPlugin.Instance.JiraPluginAttributes.Name, Language.GetString("jira", LangKey.communication_wait),
|
new PleaseWaitForm().ShowAndWait(JiraPlugin.Instance.JiraPluginAttributes.Name, Language.GetString("jira", LangKey.communication_wait),
|
||||||
delegate() {
|
delegate() {
|
||||||
|
@ -127,6 +133,9 @@ namespace Jira {
|
||||||
}
|
}
|
||||||
jira.Url = url;
|
jira.Url = url;
|
||||||
jira.Proxy = NetworkHelper.CreateProxy(new Uri(url));
|
jira.Proxy = NetworkHelper.CreateProxy(new Uri(url));
|
||||||
|
// Do not use:
|
||||||
|
//jira.AllowAutoRedirect = true;
|
||||||
|
jira.UserAgent = "Greenshot";
|
||||||
}
|
}
|
||||||
|
|
||||||
~JiraConnector() {
|
~JiraConnector() {
|
||||||
|
@ -145,10 +154,13 @@ namespace Jira {
|
||||||
try {
|
try {
|
||||||
this.credentials = jira.login(user, password);
|
this.credentials = jira.login(user, password);
|
||||||
} catch(Exception ex) {
|
} catch(Exception ex) {
|
||||||
if (!config.Url.EndsWith("wsdl")) {
|
if (!url.EndsWith("wsdl")) {
|
||||||
config.Url = config.Url + "/rpc/soap/jirasoapservice-v2?wsdl";
|
url = url + "/rpc/soap/jirasoapservice-v2?wsdl";
|
||||||
jira = new JiraSoapServiceService();
|
// recreate the service with the new url
|
||||||
|
createService();
|
||||||
this.credentials = jira.login(user, password);
|
this.credentials = jira.login(user, password);
|
||||||
|
// Worked, store the url in the configuration
|
||||||
|
config.Url = url;
|
||||||
IniConfig.Save();
|
IniConfig.Save();
|
||||||
} else {
|
} else {
|
||||||
throw ex;
|
throw ex;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue