标签:on() counter ons client als ui测试 model count system
首先确认下面几个程序集是最新版本:
<PackageReference Include="System.ServiceModel.Http" Version="4.5.3" />
<PackageReference Include="System.ServiceModel.NetTcp" Version="4.5.3" />
<PackageReference Include="System.ServiceModel.Primitives" Version="4.5.3" />
<PackageReference Include="System.ServiceModel.Security" Version="4.5.3" />
org.xml.sax.SAXException: SimpleDeserializer encountered a child element
大概率是出在sendbody格式上,通过SoapUI测试可以看到正确的数据格式。
如果是HTTPS需要在客户端加上如下代码:
client.ClientCredentials.ServiceCertificate.SslCertificateAuthentication = new System.ServiceModel.Security.X509ServiceCertificateAuthentication() { CertificateValidationMode = System.ServiceModel.Security.X509CertificateValidationMode.Custom, RevocationMode = X509RevocationMode.NoCheck, CustomCertificateValidator = new MyX509CertificateValidator("anything") }; public class MyX509CertificateValidator : X509CertificateValidator { string allowedIssuerName; public MyX509CertificateValidator(string allowedIssuerName) { this.allowedIssuerName = allowedIssuerName; } public override void Validate(X509Certificate2 certificate) { Console.WriteLine($"X509证书:{certificate?.IssuerName?.Name}"); } }
标签:on() counter ons client als ui测试 model count system
原文地址:https://www.cnblogs.com/coolyuwk/p/11002118.html