Nous avons un projet Silverlight qui utilise les services RIA. Il y a du code que je veux partager entre ce projet et un service web. Je dois laisser le code là où il est maintenant, c'est-à-dire que je ne peux pas partager le code.Consommation de services RIA sans un projet Silverlight
Ce que je pensais être bon, c'est que le service Web appelle le service RIA. Il sera assis sur le même serveur. Je suis allé à mon projet de service Web et j'ai ajouté une référence de service au service ria. J'ai cliqué sur avancé et j'ai coché l'option pour «générer des opérations asynchrones». Je pensais que tout irait bien, mais j'ai reçu quelques avertissements. Le code client qu'il a généré manquait de tout code réel relatif aux appels asynchrones, et le fichier app.config est également vide. Voici les avertissements,
Warning 2 Custom tool warning: Cannot import wsdl:binding
Detail: There was an error importing a wsdl:portType that the wsdl:binding is dependent on.
XPath to wsdl:portType: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:portType[@name='CarServiceSoap']
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='BasicHttpBinding_CarServiceSoap'] C:\Develop\DotNet\Trunk\Applications\WcfServices\CarTransmitter\CarTransmitter.Core\Service References\CarService\Reference.svcmap 1 1 CarTransmitter.Core
Warning 3 Custom tool warning: Cannot import wsdl:port
Detail: There was an error importing a wsdl:binding that the wsdl:port is dependent on.
XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='BasicHttpBinding_CarServiceSoap']
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:service[@name='CarService']/wsdl:port[@name='BasicHttpBinding_CarServiceSoap'] C:\Develop\DotNet\Trunk\Applications\WcfServices\CarTransmitter\CarTransmitter.Core\Service References\CarService\Reference.svcmap 1 1 CarTransmitter.Core
Warning 1 Custom tool warning: Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter
Error: Referenced type 'CarData.Organisation, CarData, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' with data contract name 'Organisation' in namespace 'http://schemas.datacontract.org/2004/07/CarData' cannot be used since it does not match imported DataContract. Need to exclude this type from referenced types.
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:portType[@name='CarServiceSoap'] C:\Develop\DotNet\Trunk\Applications\WcfServices\CarTransmitter\CarTransmitter.Core\Service References\CarService\Reference.svcmap 1 1 CarTransmitter.Core
Merci. J'ai changé la question. Fondamentalement, j'étais capable de travailler sur le fait que je devais sélectionner l'option 'générer des opérations asynchrones', mais cela ne générait pas vraiment de code valable. App.config était vide aussi. – peter