简体   繁体   English

.Net Web服务XML序列化器

[英].Net Web Services XML Serializer

I am using VS2015 to consume some old web services (SAP). 我正在使用VS2015消耗一些旧的Web服务(SAP)。 I can import the WSDL just fine, and all the references come across ok. 我可以很好地导入WSDL,并且所有引用都可以。 But, when I try and use the service, it looks like the XML output only includes properties with values. 但是,当我尝试使用该服务时,看起来XML输出仅包含带有值的属性。 That is not working with the WSDL service. 这不适用于WSDL服务。 I am using SoapUI to test and it can communicate just fine with the service. 我正在使用SoapUI进行测试,它可以与服务正常通信。 Using SoapUI, if I remove some of the outbound XML in the call, it will fail. 使用SoapUI,如果我删除了呼叫中的某些出站XML,它将失败。 So, I think my issue is the outbound XML serialization. 因此,我认为我的问题是出站XML序列化。 Any ideas on how to tackle this? 关于如何解决这个问题的任何想法? Is there a way to mark the properties so they will be output even if they don't have a value? 有没有办法标记这些属性,以便即使没有值也可以将其输出? (short of putting a space or something in the field? Thanks. (没有在场地上放置空格或其他东西吗?谢谢。

这是设计使然以区分null和null,看看从XmlSerializer发出抑制Null值类型

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM