Link to home
Start Free TrialLog in
Avatar of Viknes Raj
Viknes Raj

asked on

Frequent Message Requests and File Upload leads to WAS warning - WCF application

Operating System: Windows Server 2012 Standard R2
IIS Version: 8.5
ASP.NET version: 4.0
.NET Framework: 4.5

We have developed a ASP.NET/WCF application using basicHTTPBinding. This ASP.NET/WCF application exposes two methods
- to receive messages.
- to receive files (max 1MB)
The above WCF application is hosted in Server2 (shown in diagram below).

To consume the exposed method by WCF application, we have developed a ASP.NET application that is hosted in Server1. This ASP.NET application receive messages from client in the form of querystring in .aspx and send the querystring content to Server2 using the receive message exposed method. The querystring is loaded into the ASP.NET application by using Page class provided by .NET.This ASP.NET application consumes the WCF exposed method by constructing it's own SOAP envelope. Constructing a SOAP envelope involves creating a request header with SOAPAction that needs to be called and of course with correct parameters. Then a http request is sent to Server2 via HttpWebRequest. The responses from Server2 are captured using Webresponse. For our case the response that we receive is in the XML format. Thus, we parse in the XML into XmlTextReader and read to the descendent inorder to get the response value.

The overall architecture shown below:

Communication Architecture

Client  <------M1-----> Server1 <-----M2----> Server2

whereby,
Client: sends a querystring message/file using .aspx
M1: http://Server1/msg.aspx?querystringcontent
Server1: receives M1 and send to Server2 through exposed methods.
M2: http://Server1/Service1.svc
Server2: receives M2 from Server 2 on ASP.NET/WCF application.

Sample request header :

HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);            
            req.Method = "POST";
            req.Headers.Add("SOAPAction", @"http://tempuri.org/IService1/" + SOAPAction);
            req.Accept = "text/plain";
            req.ContentType = "text/xml;charset=utf-8";

Sample SOAP Envelope created :

"<?xml version=""1.0"" encoding=""utf-8""?>"
                                    + @"<soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""                                    

xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"">"
                                    + " <soap:Header></soap:Header>"
                                    + "<soap:Body>"
                                    + " <" + SOAPAction + @" xmlns=""http://tempuri.org/"">"
                                    + " <message>" + Message + "</message>"
                                    + @" </" + SOAPAction + ">"
                                    + @" </soap:Body>"
                                    + @" </soap:Envelope>");

We set the default application pool settings for the site.

The above communication works fine for a few hours until errors and warning start to appear in Windows Event Logs. Also, the Web Service throws the following error code

"HTTP Error 503 - Service unavailable".

Warning #1
Event ID: 5011
Source: Microsoft-Windows-WAS
Description:
"A process serving application pool 'x' suffered a fatal communication error with the Windows Process Activation Service. The process id was 'xx'. The data field contains the error number."

Error #1
Event ID: 5002
Source: Microsoft-Windows-WAS
Description:
"Application pool 'XXXXXXXXXX' is being automatically disabled due to a series of failures in the process(es) serving that application pool."

Could you please shine some light regarding this issue that we are facing. Below are list of questions that would help us understand better on the issue.

1) Do we need to change the IIS configuration or remain as default settings?
2) Does the type of binding we use affects the performance of our application?
3) Is WCF technology feasible for high amount of requests at a short time interval?
4) What are the limitation of WCF?

Thank you so much. We really appreciate any thoughts and help you guys can offer.
Avatar of Fareed Ali Khan
Fareed Ali Khan
Flag of Australia image

Application crash is causing the App Pool crash. You need to check your application why it is crashing. And what are the errors from application log. Share the application logs or errors call stack.
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
To get more information on the WCF service side error, enable tracing using this link, https://msdn.microsoft.com/en-us/library/ms733025(v=vs.110).aspx

Can we know why ur creating your own SOAP action ? instead of creating proxy or ChannelFactory to access your wcf service ?