【发布时间】:2012-02-01 22:09:07
【问题描述】:
我们有一个使用 RIA 服务的 silverlight 项目。我想在该项目和 Web 服务之间共享一些代码。我必须将代码留在现在的位置,即我无法共享代码。
我认为好的是让 Web 服务调用 RIA 服务。它将位于同一台服务器上。
我去了我的 Web 服务项目,并添加了对 ria 服务的服务引用。我点击了高级并勾选了“生成异步操作”选项。
我认为一切都很好,但我收到了一些警告。它生成的客户端代码缺少与异步调用相关的任何实际代码,并且 app.config 也是空的。以下是警告,
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
【问题讨论】:
标签: c# .net silverlight ria