我試圖在我的ASP.NET MVC 4站點(已經成功託管一個被動STS端點)託管一個活動的STS端點。由於某種原因,WCF運行時似乎沒有「處理」對我的servive URI的調用。如何在ASP.NET MVC 4中託管活動的STS?
在我RouteConfig.cs文件,我有這樣的:
routes.Add(new ServiceRoute("tokens", new MyTokenServiceHostFactory(), typeof(MyTokenServiceConfiguration)));
也就是說,我認爲,是舉辦服務沒有.svc文件的正確方法。在我的web.config文件中,我有這樣的:
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<!--(behaviors etc)-->
<services>
<service name="System.ServiceModel.Security.WSTrustServiceContract">
<endpoint address="" binding="ws2007HttpBinding" contract="System.ServiceModel.Security.IWSTrust13SyncContract"/>
</service>
</services>
</system.serviceModel>
配置的這大塊可以成功地用於自託管服務,我已經改變的唯一事情就是端點的地址。
當我嘗試調用服務,我得到:
System.ServiceModel.Security.MessageSecurityException:無抵押或擔保的不當故障從對方收到。查看故障代碼和細節的內部FaultException。 ---> System.ServiceModel.FaultException:消息無法處理。這很可能是因爲操作'http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Issue'不正確,或者因爲消息包含無效或過期的安全上下文標記或者因爲綁定之間存在不匹配。
在服務跟蹤登錄是:
System.ServiceModel.EndpointNotFoundException 有沒有通道可與行動「http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Issue」接受信息。
我在這裏做了什麼錯?