简体   繁体   中英

WCF change attribute nillable to nil

我在Visual Studio中使用c#开发了WS和WSDL,WSDL包含nillable =“ true”,但是客户端不支持,如何将nillable =“ true”更改为xsi:nil =“ true”。

You are confusing the XSD schema nillable attaribute with the XSD schema-instance nil attribute. They are linked, but not equivalent.

Please see http://www.w3.org/TR/xmlschema-0/#Nils for clarity.

The XSD schema nillable attribute is a decorator on the element to allow an explicit null value to be assigned to the element in conforming XML documents.

The XSD schema instance nil attribute is the way to define an explicit null value in a XML document.

the WSDL contains nillable="true", but the client does not support

You need to explain exactly what you mean by this. Is the client unable to consume the WSDL from your service? What is the error they are getting?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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