Life in my own company

Its all up to me.
posts - 137, comments - 166, trackbacks - 113

My Links

News



Twitter



Tag Cloud

Archives

Post Categories

Play

Work

Known Types

We're using Nettiers to generate our DAL and have the need to create a WCF layer for it.  So we set up the WCF layer in a codesmith template and immediately ran into a problem, we had thousands of methods in the service contract, and the service took over a minute to initialize.  Yuck.

We could have separated out the service contracts into a bunch of different contracts, but that would have been nasty--we would have had over 100 some odd different services to put in the config file.

So the next option was to make a method that allowed us to pass in the provider, method name, and parameters to the method and then call that method on the SQLClient provider using reflection.

I was able to get that wired up and then got the following message in the trace of the server call (note that I removed class names):

There was an error while trying to serialize parameter "blah". The InnerException message was 'Type 'TList`1[[Entity, dll, Version=1.0.149.0, Culture=neutral, PublicKeyToken=null]]' with data contract name 'ArrayOfEntity:http://schemas.datacontract.org/2004/07/' is not expected. Add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.'.  Please see InnerException for more details.

After some searching, I found an article about adding known types.  I'll probably opt for the static version.  We'll see how it goes.

Print | posted on Thursday, July 12, 2007 11:18 AM |

Feedback

No comments posted yet.

Post Comment

Title  
Name  
Email
Url
Comment   
Please add 8 and 5 and type the answer here:

Powered by: