Azure功能和肥皂:无法访问信封:无法从给定的源创建信封:com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl

时间:2016-12-23 09:47:42

标签: java c# azure soap azure-functions

我目前正在尝试从我的Azure功能调用SOAP服务,这会给我以下错误:

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

  

HTTP状态500 - 请求处理失败;嵌套异常是   org.springframework.ws.soap.saaj.SaajSoapEnvelopeException:无法   访问信封:无法从给定的来源创建信封:;嵌套   异常是com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl:   无法从给定来源创建信封:

这是第三方服务,用Java编写。我不知道它是如何部署的,但是,是的,因为它在Console App中工作,我觉得该服务没有任何问题:

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

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

提前感谢您的帮助

2 个答案:

答案 0 :(得分:1)

感谢Peter和vivasaayi的意见,我在这些方向上进行了调查。

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

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

let settings = AVCapturePhotoSettings()
let previewPixelType = settings.availablePreviewPhotoPixelFormatTypes.first!
let previewFormat = [kCVPixelBufferPixelFormatTypeKey as String: previewPixelType,
                             kCVPixelBufferWidthKey as String: 160,
                             kCVPixelBufferHeightKey as String: 160,
                             ]
settings.previewPhotoFormat = previewFormat
self.cameraOutput.capturePhoto(with: settings, delegate: self)

答案 1 :(得分:0)

在MSDN上有一个类似的issue,并且MSFT对这种情况的回复解释,对于没有发回任何数据的请求,有230秒的超时,请参见下文。

  

经过一番调查,我看到发生了什么。对于未发送任何数据的请求,有230秒(即少于4分钟)超时。之后,客户端获得您看到的500,即使实际上允许请求继续服务器端。

     

如果您希望进行持续时间长的服务器端处理,我建议使用以更异步方式工作的备用流程。即让用户排队生成报告,然后允许他们在完成后下载。或者作为替代方案,您可以将结果上传到blob存储,并将其提供给拾取。

     

我认为即使没有超时,大多数用户如果看到它在浏览器中旋转那么长时间,他们自己会放弃请求。因此,异步模式可以带来更好的用户体验。

希望它有所帮助。

相关问题