Si utilizo solo métodos simples en mi servicio WCF, todo funciona bien. Sin embargo, si incluyo el siguiente método, se produce un problema:Obteniendo el "Contrato de datos de recopilación recursivo" al hacer referencia a un servicio WCF con un método un tanto complejo
[OperationContract]
public List<KeyValuePair<string, string>> GetAllAccounts()
{
return AccountBusiness.GetAllAccounts();
}
me sale este error cuando se hace referencia al servicio de otro proyecto:
Warning 5 Custom tool warning: Cannot import wsdl:portType Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter Error: Type 'Newtonsoft.Json.Linq.JToken' is a recursive collection data contract which is not supported. Consider modifying the definition of collection 'Newtonsoft.Json.Linq.JToken' to remove references to itself. XPath to Error Source: //wsdl:definitions[@targetNamespace=' http://tempuri.org ']/wsdl:portType[@name='NodeService'] C:\inetpub\wwwroot\MyclientProject\Service References\NodeService\Reference.svcmap 1 1 MyClientNode
Si quito el método anterior, compilar y actualizar la referencia, entonces funciona bien. Pero cuando agrego el método anterior, constantemente recibo esta advertencia.
Una sugerencia que encontré fue desinstalar Visual Studio 2012 y reparar Visual Studio 2010. No quiero hacer eso.
Otro suggested para desmarcar "Reutilizar tipos en todos los ensamblados a los que se hace referencia", pero esto arruina las firmas de método y no se puede utilizar.
No tiene que quitar los paquetes, ahora puede usarlos en el servicio: http://nirlevy.blogspot.co.il/2012/08/cannot-import-wsdl-porttypedetail.html –
Nir , esto fue increíblemente útil. ¡Gracias! – benjy