我試圖創建由ASP.NET主辦的wcf服務(我前段時間做過,但現在我不能...)如何在enableWebScript設置時添加元數據支持?
在這一步我想添加元數據支持。一旦我添加了以下端點配置:
<endpoint address="mex" behaviorConfiguration="McActivationApp.EnrollmentServiceAspNetAjaxBehavior"
binding="mexHttpBinding" contract="IMetadataExchange" />
我有以下錯誤:
The endpoint at 'http://MyPcName/MCActivation/EnrollmentService.svc/mex' does not have a Binding with the None MessageVersion. 'System.ServiceModel.Description.WebScriptEnablingBehavior' is only intended for use with WebHttpBinding or similar bindings.
我試圖改變「IMetadataExchange接口」合同'。這會導致另一個錯誤:
The endpoint at 'http://MyPcName/MCActivation/EnrollmentService.svc/mex' does not have a Binding with the None MessageVersion. 'System.ServiceModel.Description.WebScriptEnablingBehavior' is only intended for use with WebHttpBinding or similar bindings.
請指教,我該如何正確添加對元數據的支持?
這裏是完整的'system.serviceModel'部分。
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="McActivationApp.EnrollmentServiceAspNetAjaxBehavior">
<enableWebScript />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="McActivationApp.EnrollmentServiceAspNetAjaxBehavior">
<serviceMetadata httpGetEnabled="True"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
<services>
<service behaviorConfiguration="McActivationApp.EnrollmentServiceAspNetAjaxBehavior"
name="McActivationApp.EnrollmentService">
<endpoint address="" behaviorConfiguration="McActivationApp.EnrollmentServiceAspNetAjaxBehavior"
binding="webHttpBinding" contract="McActivationApp.EnrollmentService" />
<endpoint address="mex" behaviorConfiguration="McActivationApp.EnrollmentServiceAspNetAjaxBehavior"
binding="mexHttpBinding" contract="McActivationApp.EnrollmentService" />
</service>
</services>
</system.serviceModel>
</configuration>
+1右上 - MEX終結點**不能**有任何WebScript行爲之類的東西就可以啓用! – 2011-01-08 08:01:22