C# Class Senparc.Weixin.MP.Agent.MessageAgent

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

Public Methods

Method Description
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结果

Method Details

CheckUrlAndToken() public static method

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

RequestResponseMessage() public static method

获取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 代理请求超时时间(毫秒)
return IResponseMessageBase

RequestResponseMessage() public static method

获取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 代理请求超时时间(毫秒)
return IResponseMessageBase

RequestWeiWeiHiXml() public static method

对接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 代理请求超时时间(毫秒)
return string

RequestWeiweihiResponseMessage() public static method

获取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 代理请求超时时间(毫秒)
return IResponseMessageBase

RequestWeiweihiResponseMessage() public static method

获取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 代理请求超时时间(毫秒)
return IResponseMessageBase

RequestWeiweihiResponseMessage() public static method

获取微微嗨(前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 代理请求超时时间(毫秒)
return IResponseMessageBase

RequestXml() public static method

获取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 代理请求超时时间(毫秒)
return string

RequestXml() public static method

获取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 代理请求超时时间(毫秒)
return string