我有微信調試正式戶口。我已經進入我的公開網址和令牌進入該領域提供http://admin.wechat.com/debug/sandbox也試圖調試與請求http://admin.wechat.com/debug/沒有得到微信按照響應
我的ASP.Net [.Net4.5]的Web API應用程序的POST方法如下所示:
public HttpResponseMessage PostMessage([FromBody]Strikemedia.Api.WeChat.TextMessage value)
{
if (value == null)
{
var richMediaMessage = new RichMediaMessage();
richMediaMessage.touser = value.FromuserName;
//Create Article
var item = new Article()
{
title = "Didn't receive anything back",
description = "Mind entering 'test'",
picurl = "URL",
url = "URL"
};
var articles = new List<Article>();
articles.Add(item);
richMediaMessage.articles = articles;
richMediaMessage.articleCount = articles.Count;
return Request.CreateResponse(HttpStatusCode.OK, richMediaMessage, "application/json");
}
var exploded = value.Content.Split(' ')[0];
var richMedia = new RichMediaMessage();
richMedia.touser = value.FromuserName;
//Create Article
var article = new Article() {
title = response.KeywordDescription,
description = response.Response,
picurl = "URL",
url = "URL"
};
var _articles = new List<Article>();
_articles.Add(article);
richMedia.articles = _articles;
richMedia.articleCount = _articles.Count;
//Return response
var resp = Request.CreateResponse(HttpStatusCode.OK, richMedia, "application/json");
//resp.RequestMessage.Content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/json");
return resp;
}
它需要使用JSON格式的RichMessageType進行響應並以XML格式接收
我是否錯過了某些東西或者是否忽略了某些內容?
我們試圖弄清楚需要繼續的URL和令牌,但是在多次嘗試提交所需的echostr後,面板仍然發出「配置失敗」錯誤 – Cipher
我們提供的請求URL是weChat: http://api.strikemedia.co.za/WeChat/WeChatTest/api/request?signature=e6448061ece1c0f30e6364b8584f0c76a2db1150&echostr=6496574268439509975×tamp=1397132240&nonce=119870065 它返回從我們身邊 – Cipher
text/plain類型響應如有api.strikemedia.co確認。 za是一個負載平衡的解決方案?如果是這樣,你必須刪除簽名驗證。 – DeveloperX