I am currently trying to invoke a SOAP service from my Azure Function which is giving me following error:
However, I am successfully able to process the request from .NET application.
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:
This is a third-party service and its written in Java. I have no idea of how it is deployed, but yes, as it works from Console App, I feel there isn't anything wrong with the service:
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);
}
Could anyone please suggest what could be wrong here?
Thanks in advance for your help
Thanks Peter and vivasaayi for your comments and I did investigations in those directions.
But, as I have no control over spring framework on server, I couldn't upgrade it. Also, my requests were of relatively small duration in terms of execution time, so the timeout was not an issue either.
I could fix it by adding following line of code in my .NET client