The custom collection type is not reused for the WCF client.

In the class library project, I defined the following type.

[CollectionDataContract()]
   public class OperationException:System.Collections.Generic.Dictionary<string,ExceptionData>
    {
       [DataMember()]
       public bool ExceptionExists { get; set; }
    }

   [DataContract()]
   public class ExceptionData {[DataMember()] public string Msg;}

At the end of my WCF service, I return an object that contains the above class as a child variable like this.

[DataContract()]
public class SaveClient
{
  [DataMember()]
   public string Id;
  [DataMember()]
   public OperationException ExceptionCollection;
}

I have an OperationException class library pointed at the client side. The problem is that when I create a proxy server using the Add Service Reference, a new OperationException definition is generated for the type dictionary. I have a Reuse Types parameter set to true. I like to use Actual 'OperationException', because I have to pass this object to other methods.

Thanks at Advance ..!

Iftikhar.

+5
source share
2

, , , CollectionDataContract - .

, Reference.svcmap , .

Reference.svcmap CollectionMappings , :

<CollectionMappings>
  <CollectionMapping TypeName="YourSharedAssemblyNamespace.OperationException" Category="List" />
</CollectionMappings>

, , svcutil , .

/collectionType:YourSharedAssemblyNamespace.OperationException

:

http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/09eefbbc-bf63-4aa3-a0cb-01a9dbd7f496/

http://www.codeproject.com/KB/WCF/WCFCollectionTypeSharing.aspx

, - WCF , , WCF.

+3

- , ?

-, svcutil, , , . , ClientBase, . , .

+1

All Articles