2013-03-06 66 views
1

嗨社區的真棒人,XAML Image Source不適用於https?

在我的XAML我想使用圖像的源屬性的絕對URI。

如果URI是「http」,它就起作用。如果URI是「https」,它不會。

爲了備份並將其放在上下文中,我通過REST API連接到JIRA,並對反饋進行反序列化,這給了我一個JIRA問題。該問題具有問題類型,並且問題類型具有我綁定到的「iconUrl」屬性。

我已調試並驗證所有正確的點。我相信這是獲得正確認證的問題,所以我對圖像的請求不會被拒絕。

我JiraRestClient構造函數(使用RestSharp):

public JiraRestClient(string baseUrl, string username, string password) 
{ 
    this.BaseUrl = baseUrl; 
    this.ServerUrl = baseUrl.Substring(0, baseUrl.IndexOf("rest")); 
    client = new RestClient(); 
    client.BaseUrl = baseUrl; 
    client.Authenticator = new HttpBasicAuthenticator(username, password); //culprit?? 
} 

我的客戶端使用:

public JiraIssue GetIssueByID(string issueKeyOrId) 
{ 
    request = new RestRequest(); 
    request.Resource = "issue/" + issueKeyOrId; 
    IRestResponse response = client.Execute(request); 
    JavaScriptSerializer serializer = new JavaScriptSerializer(); 
    // Deserialize the response into a JiraIssue object 
    JiraIssue issue = serializer.Deserialize<JiraIssue>(response.Content); 
    ... 
    return issue; 
} 

後我已經驗證,並創建我的REST客戶端,我只是想拉在XAML中的issuetype圖像直接(在這裏,我用一個絕對的URI取代了綁定,這也是不起作用的):

... 
<Image Height="16" Width="16" Source="https://..."/> 
... 

我錯過了什麼?什麼與HttpBasicAuthenticator? 在此先感謝!

回答

0

問題的根源在於我試圖綁定的圖像/圖標實際上並不存在於JIRA服務器上;他們在Confluence網站上作爲wiki頁面的附件。所以,這個問題與HTTPS無關,更多的與Confluence驗證以下載圖像。