zoukankan      html  css  js  c++  java
  • System.InvalidOperationException : 不应有 <Response xmlns=''>。

    xml如下:

    复制代码
    <?xml version="1.0" encoding="UTF-8"?>
    <Response version="2">
      <datacash_reference>4700203048783633</datacash_reference>
      <information>Failed to identify the card scheme of the supplied card number</information>
      <merchantreference>1000001</merchantreference>
      <mode>TEST</mode>
      <reason>Invalid card type</reason>
      <status>21</status>
      <time>1382512427</time>
    </Response>
    复制代码

    原来的Entity如下:

        [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
        [Serializable()]
        [System.Diagnostics.DebuggerStepThroughAttribute()]
        [System.ComponentModel.DesignerCategoryAttribute("code")]
        [XmlType(AnonymousType = true)]
        [XmlRoot(Namespace = "", IsNullable = false)]

    解决方案需要增加ElementName = "Response",如下:

        [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
        [Serializable()]
        [System.Diagnostics.DebuggerStepThroughAttribute()]
        [System.ComponentModel.DesignerCategoryAttribute("code")]
        [XmlType(AnonymousType = true)]
        [XmlRoot(Namespace = "", IsNullable = false, ElementName = "Response")]

    Done!

     
    分类: C#
  • 相关阅读:
    自动生成小学四则运算题目
    python自动生成小学四则运算题目
    大学排名
    中国大学排名
    pachong
    paiqiu
    文件管理
    软件工程课作业 2020-11-23
    时序图,E-R图,数据流程图
    考研信息查询系统需求规格说明书
  • 原文地址:https://www.cnblogs.com/shiningrise/p/6080368.html
Copyright © 2011-2022 走看看