interface IVideoDateQueue
{
[OperationContract]
[WebInvoke(
UriTemplate = ""
, Method = "POST"
, ResponseFormat = WebMessageFormat.Xml
, BodyStyle = WebMessageBodyStyle.Bare
)]
string GetVideoDate(string searchXml); }
public string GetVideoDate(string searchXml)
{
return "<?xml version=\"1.0\" encoding=\"utf-8\"?><data><a>123</a></data>";
}
——————————————————————————————————————
返回的结果是 <string><?xml version=\"1.0\" encoding=\"utf-8\"?><data><a>123</a></data></string>
WCF
{
[OperationContract]
[WebInvoke(
UriTemplate = ""
, Method = "POST"
, ResponseFormat = WebMessageFormat.Xml
, BodyStyle = WebMessageBodyStyle.Bare
)]
string GetVideoDate(string searchXml); }
public string GetVideoDate(string searchXml)
{
return "<?xml version=\"1.0\" encoding=\"utf-8\"?><data><a>123</a></data>";
}
——————————————————————————————————————
返回的结果是 <string><?xml version=\"1.0\" encoding=\"utf-8\"?><data><a>123</a></data></string>
WCF
无法序列化类型“System.Xml.XmlDocument”。请考虑将其标以 DataContractAttribute 特性,并将其所有要序列化的成员标以 DataMemberAttribute 特性。如果类型为集合,则请考虑将其标以 CollectionDataContractAttribute 特性。有关其他受支持的类型,请参见 Microsoft .NET Framework 文档。 Stream可以了,谢谢了