Monday, March 26, 2012

Strange error

Hello everyone,

I have a C# web aplication that uses ASP.NET as FRONT END and for the Logical and Data Layers i have Webservices that connect to SQL and use stored procedures.

From time to time when i open my browser and run the application either for test or to show something to someone i get this Error

--> COPY PASTE <--

Server Error in '/cpin' Application.
------------------------

Server was unable to process request. --> General network error. Check your network documentation.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.Services.Protocols.SoapException: Server was unable to process request. --> General network error. Check your network documentation.

Source Error:

Line 297: [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.cpin.pt/webservices/GetLinguagens", RequestNamespace="http://www.cpin.pt/webservices", ResponseNamespace="http://www.cpin.pt/webservices", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
Line 298: public System.Data.DataSet GetLinguagens() {
Line 299: object[] results = this.Invoke("GetLinguagens", new object[0]);
Line 300: return ((System.Data.DataSet)(results[0]));
Line 301: }

Source File: f:\webserver\cpin\web references\core\reference.cs Line: 299

Stack Trace:

[SoapException: Server was unable to process request. --> General network error. Check your network documentation.]
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) +1489
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +218
Cpin.Core.CoreWS.GetLinguagens() in f:\webserver\cpin\web references\core\reference.cs:299
Cpin.MainPage.Page_Load(Object sender, EventArgs e) in f:\webserver\cpin\default.aspx.cs:31
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731

------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573

--> END OF COPY PASTE <--

I can't figure out why i get this error :(

Just for the record if i refresh it either apears again or just works wonderfuly till next time...

All my network works fine... just this wierd error...

Don't know what to do. Anyone has an idea?

RegardsI had this same problem. Sometimes my page worked, othertimes it failed.

It turned out that I was compiling my app against a different version of the .NET framework than that used on the server to which I deployed my app.

So, check whether your local framework version is the same as that on the remote machine that is deploying your app (or exposing your web services, in this case).
Hello mate, thanks for your post.

Everything is running the version that is posted in the last line of the error.

:/ Any other ideas?
I don't have an answer, but I have three suggestions.

First, since a web service is, by definition, on a computer other than your own, you cannot presume that web service will always be available (unlike a local DLL which you can presume to be there). So, any web service requestsmust be wrapped in a Try/Catch exception handler ... with the Catch providing the response "web service currently unavailable". Particularly if, as you mention, you are showing your app/service to someone, a friendly error message is much more professional than an unhandled exception.

Second, the error message mentions an Asynchronous switch. Thinking along those lines, if your refreshing sometimes works and othertimes doesn't work, perhaps your app and your web service are getting out of synch? Microsoft'sApplication Architecture for .NET: Designing Applications and Services talks about controlling caching, synchronicity and messaging in web services. It's an incredibly helpful planning document, so download it for reference even if you find an easy fix for your current problem.

Third, your error message is SOAP-specific, so you might try asking your question atthis forum. I don't think this counts as a Getting Started newbie question :)

0 comments:

Post a Comment