首页 > 解决方案 > 部署后,soapClient.Login 到 Windows 窗体应用程序中的 Acumatica 失败。“向 https 发出 HTTP 请求时发生错误..”

问题描述

使用 Contract SOAP to Acumatica 的 Windows 窗体应用程序在开发机器上运行良好。

在生产服务器 (Windows 2008) 上使用完全相同参数的 soapClient.Login 崩溃并显示错误消息:

错误消息:向https://XXX.acumatica.com/entity/Default/17.200.001发出 HTTP 请求时发生错误。这可能是由于在 HTTPS 情况下未使用 HTTP.SYS 正确配置服务器证书。这也可能是由于客户端和服务器之间的安全绑定不匹配造成的。

堆栈跟踪:服务器堆栈跟踪:在 System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan 超时)在 System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException,HttpWebRequest 请求,HttpAbortReason abortReason)。 ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout) at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation , Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy。调用(IMessage 消息)

在 [0] 处重新引发异常:在 AcmtIntegrator.AcumaticaWSDL 的 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) 处的 System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)。 D:\C2019\AcumaticaIntegrator AcmtIntegrator.AcumaticaWSDL.DefaultSoapClient.Login(String name, String password, String company, String branch, String locale) 中的 DefaultSoap.Login(String name, String password, String company, String branch, String locale) \AcumaticaIntegrator\Connected Services\AcumaticaWSDL\Reference.cs:line 49298 at AcmtIntegrator.frmExtractLists.LoopAction(String lcAction, String lcExtractType, Boolean& llSuccess) in D:\C2019\AcumaticaIntegrator\AcumaticaIntegrator\frmExtractLists.cs:line 134,来源:mscorlib ,InnerException:底层连接已关闭:发送时发生意外错误。,

标签: acumatica

解决方案


更改了两个修复程序以使其正常工作:

  1. WSDL 服务引用被替换为指向 Acumatica 生产 URL,并且

  2. 安全协议设置为 TLS 1.2:System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;

感谢所有试图提供帮助的人。


推荐阅读