2011-10-24 49 views
1

我收到了兩個問題,但我認爲這有問題。WCF&Rest&ISA&Output

我做了一個帶有.NET4的WCF Rest服務,並且只在https上。在我的本地電腦上,一切都很好。

現在我將它部署到託管提供商。對於我所知道的所有請求都通過ISA服務器。

起初,它沒有奏效。我嘗試了很多,但我總是得到錯誤404,找不到資源。具體錯誤是:

[EndpointNotFoundException]: There was no channel actively listening at 
'http://mydomainname/items/help'. 
This is often caused by an incorrect address URI. 
Ensure that the address to which the message is sent matches 
an address on which a service is listening. 

我看到的第一件事情是,異常中的URL不是https。好吧,奇怪的是,因爲我的web.config是:

<serviceBehaviors> 
    <behavior name=""> 
     <serviceMetadata httpsGetEnabled="true" /> 
     <serviceAuthorization serviceAuthorizationManagerType="myNamespace.APIKeyAuthorization, myNamespace" /> 
    </behavior> 
    </serviceBehaviors> 
... 
    <webHttpBinding> 
    <binding name=""> 
     <security mode="Transport"> 
     <transport clientCredentialType="Basic" /> 
     </security> 
    </binding> 
    </webHttpBinding> 
... 
    <webHttpEndpoint> 
    <standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="true" defaultOutgoingResponseFormat="Json"> 
     <security mode="Transport"> 
     <transport clientCredentialType="Basic" /> 
     </security> 
    </standardEndpoint> 
    </webHttpEndpoint> 

所以我嘗試了很多東西,但最終我使它的工作。我只是到處都是名字。在行爲標記中,綁定和標準點標記。有用 !! 好的,差不多。 現在我所有的結果都是XML格式。我沒有json。即使是使用「Accept:application/json」或「Accept:text/json」這一行的提琴手,它總是以XML格式。即使我把automaticFormatSelectionEnabled設置爲false。 並添加「幫助」的URL,如「https:// mydomainname /項目/幫助」我得到了「終點沒有找到」

所以,現在我迷路了,因爲我不明白所有WCF中的小配置使一切正常工作。 希望你能幫助我。

在此先感謝。

M.

+0

對於我的理解(現在),我敢肯定的是,standardendpoint名*必須*爲空獲得功能REST服務。我感覺卡住了... – Mescal

回答

0

OK,我不知道這是否可以被視爲良好的答案,但管理由ISA服務器上的東西。 所以現在它完全正常工作。

M.