【发布时间】:2011-12-06 18:12:04
【问题描述】:
我有一个 WPF 客户端,它连接到一个非常简单的 ISS 应用程序上的 WCF 端点。我想将 Silverlight 应用程序连接到相同的 WCF 服务。我读过我必须启用 OData。这在4中还有必要吗?如果是这样,我该怎么做?我如何实际连接端点?我是否需要使用 RIA 服务来促进连接?我可以使用同一个 IIS 应用程序来提供两个端点吗?
提前感谢您的帮助。这个让我难过。
编辑:
以下是我的 WCF 服务和 Silverlight 客户端的配置。
WCF 服务器配置(混淆):
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding maxReceivedMessageSize="2147483647">
<security mode="Transport">
<transport clientCredentialType="None"/>
</security>
</binding>
</wsHttpBinding>
<basicHttpBinding>
<binding maxReceivedMessageSize="2147483647">
<security mode="Transport">
<transport clientCredentialType="None"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="MyNamespace.Services.MyService">
<endpoint contract="MyNamespace.ServiceContracts.IMyService"
address=""
binding="wsHttpBinding"
/>
<endpoint contract="MyNamespace.ServiceContracts.IMyService"
address="basic"
binding="basicHttpBinding"
/>
<endpoint contract="IMetadataExchange"
address="mex"
binding="mexHttpBinding"
/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="True" />
<serviceDebug includeExceptionDetailInFaults="False" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
Silverlight 客户端配置(混淆):
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="Binding.Secure" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647">
<security mode="Transport" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint name="MyServiceReferenceNamespace.MyService"
contract="MyServiceReferenceNamespace.IMyService"
address="https://www.mydomain.com/MyVirtualDirectory/MyContract.svc"
binding="basicHttpBinding"
bindingConfiguration="Binding.Secure"
/>
</system.serviceModel>
(为了保护我的客户,我们更改了名称。)
【问题讨论】:
标签: silverlight wcf wcf-ria-services