在 C# 中将变量插入到 XML SOAP 请求的内插字符串中
您好,我正在尝试将另一个变量插入到字符串中,字典变量中的变量工作正常,但我需要在该部分的上部插入另一个变量,我该怎么做?
public static string SendRequest(Dictionary<string, string> parameters)
<soap:Body>
<tem:Section1>
<tem:token>
**INSERT ANOTHER VARIABLE HERE**
</tem:token>
<tem:Section2>
<{0} xmlns=""{1}"">{2}</{0}>
</tem:Section2>
</tem:Section1>
</soap:Body>
string parms = string.Join(string.Empty, parameters.Select(kv => String.Format("<{0}>{1}</{0}>", kv.Key, kv.Value)).ToArray());
Hi i'm trying to insert another variable into a string, the ones that comes in the dictionary variable works fine, but i need to insert another upper that section, how can i do it?
public static string SendRequest(Dictionary<string, string> parameters)
<soap:Body>
<tem:Section1>
<tem:token>
**INSERT ANOTHER VARIABLE HERE**
</tem:token>
<tem:Section2>
<{0} xmlns=""{1}"">{2}</{0}>
</tem:Section2>
</tem:Section1>
</soap:Body>
string parms = string.Join(string.Empty, parameters.Select(kv => String.Format("<{0}>{1}</{0}>", kv.Key, kv.Value)).ToArray());
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论