C# WCF web http服务不返回xmlns
我创建了一个简单的REST web服务。。回答是这样的C# WCF web http服务不返回xmlns,c#,wcf,.net-4.0,C#,Wcf,.net 4.0,我创建了一个简单的REST web服务。。回答是这样的 <?xml version="1.0" encoding="utf-8"?> <ArrayOfTableCategories xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 使用此属性 [XmlSerializerF
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfTableCategories xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
使用此属性
[XmlSerializerFormat]
但是我看不到有xmlns。。。像坦普里
但当尝试发出请求时,如果不定义xmlns,则会出现400个错误=http://tempuri.org 在根元素处
对这种行为有什么解释吗?这与您上两个问题中的问题相同 我们经常看到WCF服务不能将列表作为返回参数
按照我在这个问题中给出的答案:这是服务电话的完整响应吗?可能不是这样,所以请查看完整XML响应中的soap元素,看看您得到了什么。您可以发布您对ArrayFTableCategories的定义吗?ArrayFTableCategories是自动生成的。它是列表。TableCategories是poco不具有[序列化]的事件。它也是一个Rest服务,所以没有soap!