日期:2014-05-17  浏览次数:20852 次

WCF string类型怎么
    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?

------解决方案--------------------
你的确让它返回了string而不是返回xml对象,如果要返回xml对象,应该是返回XmlDocument这个类型才行,或者你直接返回Stream,这样它就不会对其做任何处理,原始内容是什么就是什么。