Why would Remoting with WCF work for some calls, but not others?

Why would Remoting with WCF work for some calls, but not others?

Old forum URL: forums.lhotka.net/forums/t/5160.aspx


dlabar posted on Sunday, July 27, 2008

I have an app that is using basic http binding to remote to a server for making the database calls.  We are just in the process of deploying this to production, but for some data portal fetches, some people are getting this error consitently, 

"An error occured while receiving the HTTP response to htt:p//CSLAProd/G2DotNetDataPortalProd/WcfPortal.svc.  This could be due to the service endpoint binding not using the HTTP protocol.  This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down).  See server logs for more details."

This is especially troublesome for these reasons:

  1. I've never gotten this error on my development machine.  I've created an MSI install package in order to install the client, and every non-development machine that has this installed, is having issues, while my machine is not
  2. The error comes up only during certain database calls.  Other calls work just fine.
  3. The error only comes up in the production enviroment.  All other environments work fine.

If anyone has any suggestions, that would be more than appreciated.

 

Thanks.

sergeyb replied on Sunday, July 27, 2008

Did you try to use production DB for testing on your machine?  I wonder if this is a manifestation of a timeout issue due to length of a call…

 

Sergey Barskiy

Principal Consultant

office: 678.405.0687 | mobile: 404.388.1899

cid:_2_0648EA840648E85C001BBCB886257279
Microsoft Worldwide Partner of the Year | Custom Development Solutions, Technical Innovation

 

From: dlabar [mailto:cslanet@lhotka.net]
Sent: Sunday, July 27, 2008 6:43 AM
To: Sergey Barskiy
Subject: [CSLA .NET] Why would Remoting with WCF work for some calls, but not others?

 

I have an app that is using basic http binding to remote to a server for making the database calls.  We are just in the process of deploying this to production, but for some data portal fetches, some people are getting this error consitently, 

"An error occured while receiving the HTTP response to htt:p//CSLAProd/G2DotNetDataPortalProd/WcfPortal.svc.  This could be due to the service endpoint binding not using the HTTP protocol.  This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down).  See server logs for more details."

This is especially troublesome for these reasons:

  1. I've never gotten this error on my development machine.  I've created an MSI install package in order to install the client, and every non-development machine that has this installed, is having issues, while my machine is not
  2. The error comes up only during certain database calls.  Other calls work just fine.
  3. The error only comes up in the production enviroment.  All other environments work fine.

If anyone has any suggestions, that would be mroe than appreciated.

 

Thanks.



Paul Czywczynski replied on Sunday, July 27, 2008

Your best bet is to set up tracing on both sides of the wire. There are numerous blog posts to do this, here is a concise one:   http://dotnetwithme.blogspot.com/2007/08/wcf-diagnostics-message-logging.html

dlabar replied on Sunday, July 27, 2008

I've enabled tracing and I belive that the server is throwing a some sort of WCF Security Exception because I'm getting this exception:

 

There was an error while trying to serialize parameter http://ws.lhotka.net/WcfDataPortal:FetchResult. The InnerException message was 'Enum value '0' is invalid for type 'System.Security.Permissions.SecurityAction' and cannot be serialized. Ensure that the necessary enum values are present and are marked with EnumMemberAttribute attribute if the type has DataContractAttribute attribute.'.  Please see InnerException for more details.

 

and it is mentioned in this thread (http://forums.lhotka.net/forums/thread/14905.aspx ) which Rocky posted a response of (http://www.lhotka.net/weblog/WCFNetDataContractSerializerAndSecurityException.aspx) .

 

Now I need to figure out what the Security Exception that I'm throwing is, so that I can get this resolved.  Any ideas?  Any ideas why it is only for certain business objects?

RockfordLhotka replied on Sunday, July 27, 2008

What version of CSLA are you using?

The issue of serializing a security exception (at least one thrown by CSLA itself) was resolved in some point release (see the change logs). It turns out that SecurityException isn't like other exceptions, and requires a little extra work to serialize properly.

I don't remember the details, it was months ago that I did the research on this - but it should be resolved in some point release of 3.0.x or later.

(that said, I suppose it is possible I missed applying the fix to some bit of CSLA code that raises a SecurityException - you can compare all cases of "new SecurityException()" in CSLA to see if one is different)

Copyright (c) Marimer LLC