儘管讀了很多帖子,例如(This one seems popular)我似乎無法將我的服務公開爲與SOAP和REST協議兼容的多個端點 - 我的問題似乎與沒有WebServiceHostFactory的WCF REST和SOAP服務
Factory="System.ServiceModel.Activation.WebServiceHostFactory"
元素在頁面後面的服務代碼中。
如果我不說,我的SOAP端點工作得很好,但找不到我的JSON端點。如果我放入該行,我的REST終結點節點會像bird一樣唱歌,並且SOAP終結點將導致Service.svc頁面中出現「Endpoint not found」。
我的行動似乎建立在標準的方式如:
[OperationContract]
[WebGet(UriTemplate = "/GetData", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
string GetData();
和配置文件
<endpoint address="rest" binding="webHttpBinding" contract=".IMeterService" behaviorConfiguration="REST" />
<endpoint address="soap" binding="wsHttpBinding" contract="IMeterService" bindingConfiguration="secureBasic" />
<behavior name="REST">
<webHttp />
</behavior>
我怎樣才能做到這一點?有沒有辦法設置REST端點而沒有 System.ServiceModel.Activation.WebServiceHostFactory屬性?
在此先感謝。
http://www.c-sharpcorner。com/uploadfile/dhananjaycoder/windows-authentication-on-rest-enabled-wcf-service/ – MaxRecursion