private void InitializeWeChatService() { DefaultWeChatMessageFactory messageFactory = new DefaultWeChatMessageFactory(); DefaultWeChatMessageHandlerFactory handlerFactory = new DefaultWeChatMessageHandlerFactory(); handlerFactory.RegisterHandlers(BuildManager.GetReferencedAssemblies().Cast <Assembly>().ToArray()); IOfficialAccountService service = new OfficialAccountPlatform( "sIk2kkJ5Uop0wpn3vb8bbxre", "gh_4dc650e1f33e", "wx3bb5c391e663740c", "2fe7aa96e28b58540d528d01162cfe63", messageFactory, handlerFactory); //IOfficialAccountService service = new OfficialAccountPlatform( // "sIk2kkJ5Uop0wpn3vb8bbxre", // "gh_4dc650e1f33e", // "wx8426e58b42376f1c", // "66558422944689bc531bc9093d47b714", // messageFactory, // handlerFactory); HttpRuntime.Cache[SERVICE_CACHE_KEY] = service; }
public void GetMessageTest_TextMessage() { DefaultWeChatMessageFactory target = new DefaultWeChatMessageFactory(); IWeChatMessage message = target.GetMessage(Xphter.Framework.Test.Properties.Resources.WeChatTextMessage, null); }