我需要使用WCF WebGet方法下载xml文件。
我准备了xml字符串,我只想将其写入某个文件然后下载。
public string xmlString = @"<?xml version=""1.0"" encoding=""utf-8"" standalone=""no""?>
<NamedRecon>
<Recon>
<Name>Accounting Cash Performance 2 Assets</Name>
<Description></Description>
<Type>Accounting Cash</Type>
<FundName>IVP</FundName>
<PBName>JPMC</PBName>
<reportviewerid></reportviewerid>
<is_month_end>false</is_month_end>
<is_continuity_enabled>false</is_continuity_enabled>
<recon_frequency_id>1</recon_frequency_id>
<fund_mail_ids></fund_mail_ids>
<pb_mail_ids></pb_mail_ids>
<recon_tags></recon_tags>
<NormalizedView>
<Name></Name>
</NormalizedView>
</Recon>
</NamedRecon>";
我想我在这里不清楚,所以让我提出更多想法。基本上我没有遇到任何错误。我要求
我已经完成了1和2,因为我是WCF的新手,所以需要第3点的帮助。任何帮助将不胜感激。
基本上在点击用户界面时有一个按钮,我需要下载一个xml文件。
答案 0 :(得分:0)
您可以编写一个返回XmlElement的方法,它非常简单:
public XmlElement ReturnXml ()
{
public string xmlString = @".....";
XmlDocument doc = new XmlDocument();
doc.Load(new System.IO.StringReader(xmlString));
return doc.DocumentElement;
}
希望有所帮助