从wcf服务响应的结果中生成xml

问题描述 投票:2回答:1

我想从wcf中的服务响应结果中创建一个xml,这是我的代码的一部分,我无法在以下代码中记录“serviceresult”:

public object InvokeEnd(object instance, out object[] outputs, IAsyncResult result)
{
    logger.InfoFormat("InvokeEnd Start command operation:{0}", this.operationName);                        

    var serviceResult =  this.invoker.InvokeEnd(instance, out outputs, result);

    logger.InfoFormat("Method {0} - Result :{1}", this.operationName, result.ToString());
    return serviceResult;
}
c# web-services wcf logging log4net
1个回答
0
投票

你能做一些XML序列化吗?

像这样:

System.Xml.Serialization.XmlSerializer x = new System.Xml.Serialization.XmlSerializer(p.GetType());

x.Serialize(Console.Out,p);
Console.WriteLine();
Console.ReadLine();

来自:https://support.microsoft.com/en-us/kb/815813

© www.soinside.com 2019 - 2024. All rights reserved.