5 mai 2008

Silverlight 2 et Webservice

Pour accéder au Webservice via un client silverlight, il faut activer le cross domaine pour que le webService asmx ou WCF communique avec l'application Silverlight.

Pour cela, il suffit d'ajouter le fichier clientaccesspolicy.xml dans le répertoire contenant le web service.
Le contenu de ce fichier est:


-
-
-
-


-




Wcf Datacontract error with Linq

Erreur:
"Type System.Data.Objects.Entity' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute."

Pour résoudre l'erreur, ajouter l'attribut [DataContract()] dans le designer du fichier dbml pour chaque objets.