【问题标题】:How to remove method name as the XML root tag in SOAP response如何在 SOAP 响应中删除方法名称作为 XML 根标记
【发布时间】:2016-08-03 09:55:07
【问题描述】:

我正在从我的 web 服务方法返回一个 XMLDocument 对象。在响应中,我可以将方法名称视为根元素。如何不包含该元素。

例如:MethodName 是 ValidationMethod 然后在结果中我得到 <ValidationMethodResult> 作为皂体中的根参数。

我尝试过声明为:

(ParameterStyle = SoapParameterStyle.Bare)

没用。

【问题讨论】:

    标签: asp.net web-services soap


    【解决方案1】:

    ValidationMethodResult 是类名,而不是方法名。 要自定义消息,请检查:https://msdn.microsoft.com/en-us/library/dkwy2d72(v=vs.100).aspx

    【讨论】:

    • Dexion,类名是 ValidationServvice ,在 XMLResponse 中我可以看到我在 WebMethodAttribute 中提到的 XMLElementAttribute 名称
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-16
    • 1970-01-01
    • 2013-05-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多