locked
Implementing a generic contract RRS feed

  • Question

  •  

    Hello,

     

    I have a similar problem like Jeffery Mjf in this thread http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=3519240&SiteID=1

     

    His solution fixes my problem, but I'm interested in an statement from the MRDS Crew whether this is a bug or a change in the new release...

     

    Because I can't find any problem with the DataMember / DataContract Attributes in my Generic Assembly...

     

    Now half of my services implementing a generic service use the proxy assembly and the others use the source assembly of the generic service... (I don't think that a good solution looks like this :-) )

    Which assembly should be referenced in a service implementing a generic service?

    The proxy or the source assembly???

    Monday, August 11, 2008 4:50 PM

Answers

  • Sailor, this is a regression in CTP2. In CTP2, when we rewrote the entire proxy generation and runtime loading,. we moved to a completely dynamic loading mechanism (no pereloading of proxy types). This allows us to load XML files that have a variety of proxy type sin them and dynamically deserialize them without requiring the use to know whats in there!.

     

    Now, the bug is that some types (transforms) are not properly registered. This is now fixed, but for CTP2 you have to explicitly register some types (your proxy state type for example), THEN save/load state.

     

    thanx

    g

     

    • Marked as answer by Trevor Taylor Sunday, May 16, 2010 12:37 AM
    Tuesday, August 26, 2008 6:04 PM

All replies

  • The main problem when using the proxy assembly is, that the base.SaveState() method is no longer working...

    Tuesday, August 12, 2008 12:28 PM
  • SaveState() is just a convenient wrapper. It sends a message to the Mount service. See the following post:

    http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=3728312&SiteID=1

     

    However, I don't quite understand your point about SaveState. All services have this method. A service that implements a generic contract should have a state that is a superset of the generic state.

     

    As a general rule, you should use Proxies, even for the generic contract.

     

    Trevor

     

    Thursday, August 14, 2008 6:25 AM
  • When I use the proxy assembly when implementing the generic contract, my state (and operations port) is also of the proxy type.
    And when I try to deserialize / serialize (with base.SaveState) a proxy state, there is an error entry in the log, telling me that is was not possible to deserialize my state!
    Wednesday, August 20, 2008 5:40 PM
  • Sailor, this is a regression in CTP2. In CTP2, when we rewrote the entire proxy generation and runtime loading,. we moved to a completely dynamic loading mechanism (no pereloading of proxy types). This allows us to load XML files that have a variety of proxy type sin them and dynamically deserialize them without requiring the use to know whats in there!.

     

    Now, the bug is that some types (transforms) are not properly registered. This is now fixed, but for CTP2 you have to explicitly register some types (your proxy state type for example), THEN save/load state.

     

    thanx

    g

     

    • Marked as answer by Trevor Taylor Sunday, May 16, 2010 12:37 AM
    Tuesday, August 26, 2008 6:04 PM