[英]HTTP status 404 error while calling WCF service from ASP.NET client after web service migration from ASP.NET to WCF
[英]WCF client migration to .NET 6
我正在尝试将我的 WCF 客户端从 .NET 框架迁移到 .NET 6 使用 CoreWCF ZEFE90A8E604A7C840E88D03A676B。
我在旧项目中有这个绑定配置:
<binding name="CustomBinding_IService">
<security
defaultAlgorithmSuite="Basic128"
authenticationMode="Kerberos"
requireDerivedKeys="true"
includeTimestamp="true"
messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"
requireSignatureConfirmation="false">
<localClientSettings detectReplays="true"/>
<localServiceSettings detectReplays="true"/>
</security>
<binaryMessageEncoding/>
<httpTransport
maxReceivedMessageSize="2147483647"
maxBufferSize="2147483647"
maxBufferPoolSize="2147483647"/>
</binding>
而这个端点配置:
<endpoint
address="https://my-address/Service.svc"
binding="customBinding"
bindingConfiguration="CustomBinding_IService"
contract="TestClient.IService"
name="CustomBinding_IService">
<identity>
<servicePrincipalName value="host/test"/>
</identity>
</endpoint>
当我尝试指定此 SPN 时,我收到一个错误,即它不受支持。 是否有可能在 .NET 6 中实现这样的客户端配置?
对于客户端配置,请尝试使用CoreWCF 。
截至 2022 年 4 月,CoreWCF 已获得微软支持,但功能不全,仅支持 WCF 的部分功能,需要在原 .NET 框架中修改代码才能测试成功。
作为 WCF 的替代方案,我认为您可以考虑使用 gRPC。
.NET 6 上的 WCF 需要客户端和服务的不同 NuGet 包。
但是,据我所知,客户端不能使用配置文件来定义端点。 (该服务使用 CoreWCF.ConfigurationManager 包)。 因此必须在 C# 代码中定义 CoreWCF 客户端。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.