2つの質問がありましたが、どういうわけかそこにリンクしていると思います。
.NET4を使用し、httpsでのみWCFRestサービスを作成しました。私のローカルPCでは、すべて問題ありません。
今、私はそれをホスティングプロバイダーに展開しました。私が知っていることは、すべての要求が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ではないということです。OK、奇妙な、私の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>
たくさんのことを試しましたが、最終的にはうまくいきました。どこにでも名前を付けます。動作タグで、バインディングおよび標準エンドポイントタグ。できます !!OK、ほとんど。これで、すべての結果がXML形式になりました。私はjsonを取得しませんでした。「Accept:application / json」または「Accept:text / json」という行のフィドラーでも、常にXMLで表示されます。automaticFormatSelectionEnabledをfalseに設定しても。そして、URLに「https:// mydomainname / items/help」のように「ヘルプ」を追加すると「エンドポイントが見つかりません」というメッセージが表示されます
つまり、すべてを機能させるためのWCFの小さな構成をすべて理解していないため、今は迷子になっています。あなたが私を助けてくれることを願っています。
前もって感謝します。
M。