我有一个用作 SOAP API 的 .Net 3.5 WCF 服务。客户端现在需要发送 SOAP 1.2 信封(soap:Envelope 而不是 soapenv:Envelope),但他们仍然使用 text/xml 作为请求的内容类型,而不是 application/soap+xml
是否可以通过配置调整服务以接受此行为,或者我需要创建类似 HttpHandler 的东西来拦截请求并修改内容类型?我已经在使用在 Dispatcher 中注册的自定义消息过滤器来满足对操作的修改,因为提供了我正在阅读和路由的自定义标头。
Web 服务的当前配置如下所示:
<services>
<service behaviorConfiguration="Service1Behavior"
name="BusinessService">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="myBindingForBigArrays"
contract="IMasterService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="/12" binding="customBinding" bindingConfiguration="https12Binding"
contract="IMasterService" behaviorConfiguration="crsBehavior">
</endpoint>
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
</service>
绑定配置是
<customBinding>
<binding name="https12Binding">
<transactionFlow />
<textMessageEncoding messageVersion="Soap12">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
</textMessageEncoding>
<httpsTransport maxReceivedMessageSize="2147483647" />
</binding>
</customBinding>
<basicHttpBinding>
<binding name="myBindingForBigArrays" maxReceivedMessageSize="2147483647">
<security mode="Transport">
<transport clientCredentialType="None"/>
</security>
<readerQuotas maxDepth="64" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
</binding>
</basicHttpBinding>
慕勒3428872
相关分类