首先确认下面几个程序集是最新版本:

<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}");
}
}

  

最新文章

  1. ElasticSearch返回不同的type的序列化
  2. C#基础知识汇总
  3. DevWebForm控件,触发用客户端事件
  4. Sort 整理
  5. 无线客户端框架设计(3):基类的设计(iOS篇)
  6. grub条目示例
  7. 用cmd命令合并N个文件
  8. Discuz!图片查看插件(支持鼠标缩放、实际大小、旋转、下载)
  9. 转:MVC3系列:~Html.BeginForm与Ajax.BeginForm
  10. JS 数据类型转换-转换函数、强制类型转换、利用js变量弱类型转换
  11. windows phone (14) 简单了解Ellipse元素和Rectangle元素
  12. plsql找外键约束关联的表的方法
  13. Jmeter+badboy环境搭建
  14. PHP常用字符串处理函数
  15. HDU 5791 Two(训练题002 F)
  16. emWin监护仪界面设计,含uCOS-III和FreeRTOS两个版本
  17. Compile groovy mixed with java in Maven
  18. 第一个Eureka程序,Eureka Client的自启动原理和简要过程
  19. 开源网站流量统计系统Piwik源码分析——后台处理(二)
  20. java 之UDP编程

热门文章

  1. JavaWeb_初识过滤器Filter
  2. jquery 动态增加table行,动态删除table行
  3. STS热部署方法(springboot)
  4. 3分割线左右间距(LinearLayoutManager.VERTICAL)
  5. 选题 Scrum立会报告+燃尽图 04
  6. ffmpeg修复时间戳
  7. sql四种连接方式
  8. 写python获取android设备的GPS及姿态信息
  9. Install the Flash plug-in
  10. 用DotNetDetour HOOK .net类库