07 2011 档案
摘要:1. 如果在xml中一个complexType的属性中包含一个属性组A,而在属性组A中又包含属性组B,则B的所有属性在生成类文件时,会被忽略。 微软对此也有详细说明:http://msdn.microsoft.com/en-us/library/484632e7(v=vs.80).aspx 有个解决方法是写一个xsl文件,将所有嵌套的属性组遍历出来,写在最外层,然后再对该文件生成.2. 明明赋了值,也有xmlAttribute,但是序列化出来的文件里,该属性的值却丢失了i.e. XSD: <xs:attribute name="Start" type="xs
阅读全文
摘要:在DataContractSerializer之前有XMLSerializer, 网上关于此的比较有:http://www.danrigsby.com/blog/index.php/2008/03/07/xmlserializer-vs-datacontractserializer-serialization-in-wcf/亮点在此: 10%的性能提升.因为DataContractSerializer不支持一些xsd标签:group, all, choice...http://msdn.microsoft.com/zh-cn/library/ms733112.aspx如果要使用DataCont
阅读全文
摘要:取客户端的IP地址:var remote = System.ServiceModel.OperationContext.Current.IncomingMessageProperties[System.ServiceModel.Channels.RemoteEndpointMessageProperty.Name] as System.ServiceModel.Channels.RemoteEndpointMessageProperty;varip = remote.Address;取请求流长度:System.ServiceModel.Web.WebOperationContext.Curre
阅读全文

浙公网安备 33010602011771号