如何原始XML转换为SOAP XML在C#中? [英] How to convert Raw XML to SOAP XML in C#?
本文介绍了如何原始XML转换为SOAP XML在C#中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我从XML序列..How我可以把它转换为SOAP XML生成一些XML?...我试图做到这一点ASP.NET C#......请帮我出
I have some xml generated from the XML Serializer ..How can I convert it to SOAP XML ?...I am trying to do it ASP.NET C#...please help me out
推荐答案
有没有这样的事情作为原始XML和SOAP XML。
There's no such thing as "raw XML" and "SOAP XML".
什么是你想实现什么?如果你只是试图返回XML作为来自Web服务的响应,那么就让它进入一个XmlDocument或的XDocument,只是返回根元素:
What are you trying to accomplish? If you're just trying to return XML as a response from a web service, then just get it into an XmlDocument or XDocument, and just return the root element:
[WebMethod]
public XmlElement ReturnXml()
{
XmlDocument doc = new XmlDocument();
doc.Load(fromSomewhere);
return doc.DocumentElement;
}
这篇关于如何原始XML转换为SOAP XML在C#中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文