c# - XML 的 xsi:nil 不反序列化为 null
问题描述
我有一个 C# 项目,我从现有的 dll 中反编译了它。它使用 Microsoft.Web.Services2 和 System.Web.Services。我的客户没有消息来源,所以你知道 ;D
有一个从 WSDL 合同生成的方法:
[SoapDocumentMethod("", ParameterStyle = SoapParameterStyle.Bare, Use = SoapBindingUse.Literal)]
[return: XmlElement("getOutputMessageResponse", Namespace = "http://www.ibm.com/xmlns/prod/websphere/human-task/services/6.0")]
public XmlElement getOutputMessage([XmlElement("getOutputMessage", Namespace = "http://www.ibm.com/xmlns/prod/websphere/human-task/services/6.0")] getOutputMessage getOutputMessage1)
{
return (XmlElement) this.Invoke("getOutputMessage", new object[1]
{
(object) getOutputMessage1
})[0];
}
在代码中,我得到了这个:
XmlElement output = ... // getOutputMessage() invocation
if(output != null){
// do something...
}else{
// do something else
}
这就是问题所在。输出永远不会为空。它要么变成:
<wn:procesResponse xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wn="http://website" />
或正确填写的XML
回复。
由于 ,它应该被null
编辑xsi:nil
,最好的部分是 - 它在反编译之前工作,所以我缺少一些设置或类似的东西。
你有什么想法,这里可能有什么问题?
谢谢你的帮助!
解决方案
推荐阅读
- c++ - 函数原型未初始化的局部变量
- opencv - 是否有可能相同的代码使用openCV返回不同的结果?
- android - android.os.NetworkOnMainThreadException json requete post
- c# - C#,使用计时器触发不同的事件。
- footer - iText 7 - 最后一页的不同页脚 - PdfDictionary 中的空指针
- algorithm - Haskell中的CycleSort - 麻烦
- c# - 使用泛型类型构建查询表达式
- data-mining - R studio中的rand有效性测量
- wpf - 我正在寻找以窗口形式存在的 wpf 中的图形类
- list - 多程序列表理解