我有一个外部 CML 文件,我将它保存在 Asp.Net mvc 项目的 Xml 文件夹中
string lStrXMLRequest = System.Web.HttpContext.Current.Server.MapPath("/Xml/SoapAvailabilitySearch.xml");
StreamReader str = new StreamReader(lStrXMLRequest);
string XMLText = str.ReadToEnd();
str.Close();
XMLText.Replace("[orgname]",org);
但是我看到 orgname 没有被 org 变量中发送的值替换。任何人都可以告诉我如何将值从 c# 发送到 XML 文件。
这是我的 XML 文件:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<AvailabilitySearch xmlns="http://www.reservwire.com/namespace/WebServices/Xml">
<xiRequest>
<Authority>
<Org>[orgname]</Org>
</Authority>
</xiRequest>
</AvailabilitySearch>
</soap:Body>
</soap:Envelope>
任何帮助将非常感激。
喵喔喔
慕盖茨4494581
相关分类