C# 클래스 Senparc.Weixin.MP.Agent.MessageAgent

代理请求 注意!使用代理必然导致网络访问节点增加,会加重响应延时, 因此建议准备至少2-3秒的延迟时间的准备, 如果增加2-3秒后远远超过5秒的微信服务器等待时间, 需要慎重使用,否则可能导致用户无法收到消息。 此外这个类中的方法也可以用于模拟服务器发送消息到自己的服务器进行测试。
파일 보기 프로젝트 열기: JeffreySu/WeiXinMPSDK

공개 메소드들

메소드 설명
CheckUrlAndToken ( string url, string token, int timeOut = 2000 ) : bool

使用GET请求测试URL和TOKEN是否可用

RequestResponseMessage ( this messageHandler, string url, string token, Stream stream, int timeOut = AGENT_TIME_OUT ) : IResponseMessageBase

获取ResponseMessge结果

RequestResponseMessage ( this messageHandler, string url, string token, string xml, int timeOut = AGENT_TIME_OUT ) : IResponseMessageBase

获取ResponseMessge结果

RequestWeiWeiHiXml ( this messageHandler, string weiweihiKey, string xml, string weiweihiDomainName = "www.weiweihi.com", int timeOut = AGENT_TIME_OUT ) : string

对接Souidea(P2P)平台,获取Xml结果,使用WeiWeiHiKey对接 WeiWeiHiKey的获取方式请看:

RequestWeiweihiResponseMessage ( this messageHandler, string weiweihiKey, RequestMessageBase requestMessage, string weiweihiDomainName = "www.weiweihi.com", int timeOut = AGENT_TIME_OUT ) : IResponseMessageBase

获取Souidea开放平台的ResponseMessge结果

RequestWeiweihiResponseMessage ( this messageHandler, string weiweihiKey, System.Xml.Linq.XDocument document, string weiweihiDomainName = "www.weiweihi.com", int timeOut = AGENT_TIME_OUT ) : IResponseMessageBase

获取Souidea开放平台的ResponseMessge结果

RequestWeiweihiResponseMessage ( this messageHandler, string weiweihiKey, string xml, string weiweihiDomainName = "www.weiweihi.com", int timeOut = AGENT_TIME_OUT ) : IResponseMessageBase

获取微微嗨(前Souidea)开放平台的ResponseMessge结果

RequestXml ( this messageHandler, string url, string token, Stream stream, bool useWeiWeiHiKey = false, int timeOut = AGENT_TIME_OUT ) : string

获取Xml结果。

RequestXml ( this messageHandler, string url, string token, string xml, int timeOut = AGENT_TIME_OUT ) : string

获取Xml结果

메소드 상세

CheckUrlAndToken() 공개 정적인 메소드

使用GET请求测试URL和TOKEN是否可用
public static CheckUrlAndToken ( string url, string token, int timeOut = 2000 ) : bool
url string
token string
timeOut int 代理请求超时时间(毫秒)
리턴 bool

RequestResponseMessage() 공개 정적인 메소드

获取ResponseMessge结果
public static RequestResponseMessage ( this messageHandler, string url, string token, Stream stream, int timeOut = AGENT_TIME_OUT ) : IResponseMessageBase
messageHandler this
url string
token string
stream Stream
timeOut int 代理请求超时时间(毫秒)
리턴 IResponseMessageBase

RequestResponseMessage() 공개 정적인 메소드

获取ResponseMessge结果
public static RequestResponseMessage ( this messageHandler, string url, string token, string xml, int timeOut = AGENT_TIME_OUT ) : IResponseMessageBase
messageHandler this
url string
token string
xml string
timeOut int 代理请求超时时间(毫秒)
리턴 IResponseMessageBase

RequestWeiWeiHiXml() 공개 정적인 메소드

对接Souidea(P2P)平台,获取Xml结果,使用WeiWeiHiKey对接 WeiWeiHiKey的获取方式请看:
public static RequestWeiWeiHiXml ( this messageHandler, string weiweihiKey, string xml, string weiweihiDomainName = "www.weiweihi.com", int timeOut = AGENT_TIME_OUT ) : string
messageHandler this
weiweihiKey string
xml string
weiweihiDomainName string
timeOut int 代理请求超时时间(毫秒)
리턴 string

RequestWeiweihiResponseMessage() 공개 정적인 메소드

获取Souidea开放平台的ResponseMessge结果
public static RequestWeiweihiResponseMessage ( this messageHandler, string weiweihiKey, RequestMessageBase requestMessage, string weiweihiDomainName = "www.weiweihi.com", int timeOut = AGENT_TIME_OUT ) : IResponseMessageBase
messageHandler this
weiweihiKey string
requestMessage Senparc.Weixin.MP.Entities.RequestMessageBase
weiweihiDomainName string
timeOut int 代理请求超时时间(毫秒)
리턴 IResponseMessageBase

RequestWeiweihiResponseMessage() 공개 정적인 메소드

获取Souidea开放平台的ResponseMessge结果
public static RequestWeiweihiResponseMessage ( this messageHandler, string weiweihiKey, System.Xml.Linq.XDocument document, string weiweihiDomainName = "www.weiweihi.com", int timeOut = AGENT_TIME_OUT ) : IResponseMessageBase
messageHandler this
weiweihiKey string
document System.Xml.Linq.XDocument
weiweihiDomainName string
timeOut int 代理请求超时时间(毫秒)
리턴 IResponseMessageBase

RequestWeiweihiResponseMessage() 공개 정적인 메소드

获取微微嗨(前Souidea)开放平台的ResponseMessge结果
public static RequestWeiweihiResponseMessage ( this messageHandler, string weiweihiKey, string xml, string weiweihiDomainName = "www.weiweihi.com", int timeOut = AGENT_TIME_OUT ) : IResponseMessageBase
messageHandler this
weiweihiKey string
xml string
weiweihiDomainName string
timeOut int 代理请求超时时间(毫秒)
리턴 IResponseMessageBase

RequestXml() 공개 정적인 메소드

获取Xml结果。
public static RequestXml ( this messageHandler, string url, string token, Stream stream, bool useWeiWeiHiKey = false, int timeOut = AGENT_TIME_OUT ) : string
messageHandler this
url string
token string
stream Stream
useWeiWeiHiKey bool 是否使用WeiWeiHiKey,如果使用,则token为WeiWeiHiKey
timeOut int 代理请求超时时间(毫秒)
리턴 string

RequestXml() 공개 정적인 메소드

获取Xml结果
public static RequestXml ( this messageHandler, string url, string token, string xml, int timeOut = AGENT_TIME_OUT ) : string
messageHandler this
url string
token string
xml string
timeOut int 代理请求超时时间(毫秒)
리턴 string