gpt4 book ai didi

java - Azure Function 和 Soap : Could not access envelope: Unable to create envelope from given source: com. sun.xml.internal.messaging.saaj.SOAPExceptionImpl

转载 作者:行者123 更新时间:2023-12-01 09:05:47 26 4
gpt4 key购买 nike

我当前正在尝试从我的 Azure Function 调用 SOAP 服务,但出现以下错误:

但是,我能够成功处理来自 .NET 应用程序的请求。

HTTP Status 500 - Request processing failed; nested exception is org.springframework.ws.soap.saaj.SaajSoapEnvelopeException: Could not access envelope: Unable to create envelope from given source: ; nested exception is com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Unable to create envelope from given source:

这是一个第三方服务,用 Java 编写。我不知道它是如何部署的,但是,是的,因为它是通过控制台应用程序运行的,所以我觉得该服务没有任何问题:

string soapEndPoint = "https://<<url>>/endpoints";
string serviceOperationName = "SendLotListService";

SendLotListRequest sendLotListRequest = new SendLotListRequest();
SendLotListResponse sendLotListResponse = null;
sendLotListRequest.LotList = lotRecords.ToArray();

System.ServiceModel.BasicHttpsBinding binding = new BasicHttpsBinding(BasicHttpsSecurityMode.Transport);
binding.BypassProxyOnLocal = true;

EndpointAddress address = new EndpointAddress(soapEndPoint);

using (SendLotListServiceClient sendLotListServiceClient = new SendLotListServiceClient(binding, address))
{
OperationDescription sendLotListOperation = new OperationDescription(serviceOperationName, new ContractDescription(serviceOperationName));
sendLotListOperation.Messages.Add(new MessageDescription(serviceOperationName, MessageDirection.Input));
sendLotListServiceClient.Endpoint.Contract.Operations.Add(sendLotListOperation);
sendLotListServiceClient.Open();
sendLotListResponse = sendLotListServiceClient.SendLotList(sendLotListRequest);
}

有人可以建议这里可能出了什么问题吗?

预先感谢您的帮助

最佳答案

感谢 Peter 和 vivasaayi 的评论,我按照这些方向进行了调查。

但是,由于我无法控制服务器上的 spring 框架,因此我无法升级它。另外,就执行时间而言,我的请求持续时间相对较短,因此超时也不是问题。

我可以通过在 .NET 客户端中添加以下代码行来修复它

System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;

关于java - Azure Function 和 Soap : Could not access envelope: Unable to create envelope from given source: com. sun.xml.internal.messaging.saaj.SOAPExceptionImpl,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41298971/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com