c# - 如何从 .netcore 中的 wsdl 中删除方法名称
问题描述
我正在尝试从删除的 wsdl 中获取方法名称。我参考了许多 stackoverflow 查询并尝试使用 MessageContract(IsWrapped=false) 并在 ServiceContract 和 OperationContract 上设置以下内容
[XmlSerializerFormat(Use = OperationFormatUse.Literal, Style = OperationFormatStyle.Document, SupportFaults = true)]
但仍然没有运气,方法名称来自 SoapUI 中的肥皂请求,如下所示:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/" xmlns:the="http://schemas.datacontract.org/2004/07/xx.xxx.xxxx.xxxx">
<soapenv:Header/>
<soapenv:Body>
<tem:GetResult> <!--need to remove this-->
<!--Optional:-->
<tem:Pet>
<!--Optional:-->
<the:Name>?</the:Name>
</tem:Pet>
</tem:GetResult> <!--need to remove this-->
</soapenv:Body>
</soapenv:Envelope>
[ServiceContract]
[XmlSerializerFormat(Use = OperationFormatUse.Literal, Style = OperationFormatStyle.Document, SupportFaults = true)]
interface IPetService
{
[OperationContract]
[XmlSerializerFormat(Use = OperationFormatUse.Literal, Style = OperationFormatStyle.Document, SupportFaults = true)]
string GetResult(Pet test);
}
[MessageContract(IsWrapped = false)]
public class Pet
{
[MessageBodyMember]
public string Name { get; set; }
}
.net core 3.1 中的项目并使用soapcore 包。
任何建议将不胜感激?谢谢。
解决方案
推荐阅读
- qt - 错误:QT 中的未知模块:qml quick
- java - NoSuchBeanDefinitionException:没有适用于 Weblogic (12.2.1.3.0) 的 [weblogic.messaging.saf.internal.SAFServerService] 类型的限定 bean
- docker - “docker pull redis”在下载时卡住了
- django - 有没有办法在 django 表单中动态过滤查询集以获得正确的外键?
- syntax-error - 为什么这个简单的 LISP 函数会抛出错误?
- javascript - 如何在 jQuery timepicker 插件中设置最大时间限制
- java - 获取 URL 参数并在 HTML 页面中打印
- python - QFileDialog 总是在主窗口后面打开
- python-3.x - 如何迭代由元组列表组成的字典?
- module - Joomla 3.9.13 中的随机图像模块有问题吗?