JeffreySu / WeiXinMPSDK

微信全平台 .NET SDK, Senparc.Weixin for C#,支持 .NET Framework 及 .NET Core、.NET 8.0。已支持微信公众号、小程序、小游戏、微信支付、企业微信/企业号、开放平台、JSSDK、微信周边等全平台。 WeChat SDK for C#.
https://weixin.senparc.com
Apache License 2.0
8.43k stars 4.35k forks source link

第三方平台快速注册小程序,推送解析xml报错。 #2897

Open fishjimi opened 1 year ago

fishjimi commented 1 year ago

此版块专为反馈 bug 及提交需求服务,不负责解答开发问题,请勿发表开发问题, 如果您需要这方面的帮助,请移步问答社区https://weixin.senparc.com/QA

问题描述

快速注册小程序,微信推送回调时,报错,解析XML失败,导致业务出错

重现问题步骤(如果可以)

以下是报错日志(已隐去敏感信息)

Senparc.Weixin.Exceptions.WeixinException: RequestMessage转换出错!可能是InfoType不存在!,XML:
<xml>
  <AppId><![CDATA[xxx]]></AppId>
  <CreateTime>1691338115</CreateTime>
  <InfoType><![CDATA[notify_third_fasteregister]]></InfoType>
  <status>0</status>
  <msg><![CDATA[OK]]></msg>
  <appid><![CDATA[xxx]]></appid>
  <auth_code><![CDATA[xxx]]></auth_code>
  <info>
    <name><![CDATA[xxx]]></name>
    <code><![CDATA[xxx]]></code>
    <code_type>1</code_type>
    <legal_persona_wechat><![CDATA[xxx]]></legal_persona_wechat>
    <legal_persona_name><![CDATA[xxx]]></legal_persona_name>
    <component_phone><![CDATA[xxx]]></component_phone>
  </info>
</xml>
 ---> System.ArgumentException: Object of type 'Senparc.NeuChar.Entities.ThirdFasteRegisterInfo' cannot be converted to type 'Senparc.Weixin.Open.ThirdFasteRegisterInfo'.
微信官方文档 URL
微信官方文档快照(直接复制关键内容到下方)
发现问题的模块
模块对应的 .net 版本
开发环境
缓存环境
系统环境
联系方式

Email:

(也可将问题地址及联系方式发送到 zsu@senparc.com)

发布问题后,请保持对 issue 的关注,有时会有需要进一步沟通的信息,很长时间内没有得到答复的 issue 将被关闭。

JaneConan commented 4 months ago

@fishjimi 您好,请问您现在这个问题解决了么,您把咱们nuget升级到最新版本,再试试呢 ThirdFasteRegisterInfo这个类里,我们没看到您提到的InfoType

https://github.com/Senparc/NeuChar/blob/cc8ab3a7494c175d68cc97fb75f536528418f9da/src/Senparc.NeuChar/Entities/Base/Request/Interfaces/Event/ThirdFasteRegisterInfo.cs#L35

image