如何为soap xml 请求添加前缀?
我正在进行 Web 服务调用(在 .Net 3.5 中)。我希望 Soap 请求具有标签的命名空间前缀(第三方 Web 服务需要它们)。
当前请求:
<soap:Body> <GetBanksList xmlns="urn:QueryGroup"> ...
所需的请求:
<soap:Body> <pfx:GetBanksList xmlns:pfx ="urn:QueryGroup"> ...
看来我应该使用这个属性:
[XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
并指定我的前缀,可能是这样的:
XmlSerializerNamespaces _namespaces = new XmlSerializerNamespaces(
new[] { new XmlQualifiedName("pfx", NS1) } );
我找不到的是放置属性的位置(我尝试使用 Reference.cs 中的输入参数)以及放置位置指定前缀!
感谢您的任何帮助。
I am making a web service call (in .Net 3.5). I want the Soap request to have namespace prefixes for the tags (the third-party web service needs them).
Current request:
<soap:Body> <GetBanksList xmlns="urn:QueryGroup"> ...
Desired request:
<soap:Body> <pfx:GetBanksList xmlns:pfx ="urn:QueryGroup"> ...
It seems I should use this attribute:
[XmlElementAttribute(Form = XmlSchemaForm.Unqualified)]
and specify my prefix, probably like this:
XmlSerializerNamespaces _namespaces = new XmlSerializerNamespaces(
new[] { new XmlQualifiedName("pfx", NS1) } );
What I can't find is where to put the attribute (I tried with the input params in Reference.cs) and where to specify the prefix!
Thanks for any help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论