如何解决SoapCore 读 Soap1.1
我在网上遵循了多个示例,但似乎无法使以下内容起作用。对于所有示例,以下请求都有效:
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<Process xmlns="http://sample.namespace.com/service/2.19/">
<!-- Optional -->
<ActionARequest>
<Id>"Test"</Id>
<Name>"Test"</Name>
</ActionARequest>
</Process>
</Body>
</Envelope>
但是,当我将其更改为具有肥皂标签时,它不起作用。
<soap:Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<Process xmlns="http://sample.namespace.com/service/2.19/">
<!-- Optional -->
<ActionARequest>
<Id>"Test"</Id>
<Name>"Test"</Name>
</ActionARequest>
</Process>
</soap:Body>
</soap:Envelope>
是否有我遗漏的特定设置?
Startup.cs:
var transportBinding = new HttpTransportBindingElement();
var textEncodingBinding = new TextMessageEncodingBindingElement(MessageVersion.soap11,System.Text.Encoding.UTF8);
var customBinding = new CustomBinding(transportBinding,textEncodingBinding);
app.UseSoapEndpoint<ICallbackService>("/integration-service/v2_17/ActionA",customBinding,SoapSerializer.XmlSerializer);
解决方法
在你的第二个例子中:
<soap:Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
应该是:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。