我有两个问题,但我认为在某种程度上是有联系的。
我用.NET4做了一个WCF服务,而且只在https上。在我本地的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。好吧,很奇怪,因为我的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>
所以我尝试了很多方法,但最后还是成功了。我刚把名字放在每一个地方。在behavior标签中,绑定和标准端点标签。它成功了!!好了差不多了。现在我所有的结果都是XML格式的。我没有json。即使使用"Accept: application/json“或"Accept: text/json”一行的小提琴,它仍然是XML。即使我将automaticFormatSelectionEnabled设置为false。将"Help“添加到URL中,比如"https://mydomainname/items/help”,我得到了一个"Endpoint not found“
所以,现在我迷路了,因为我不理解WCF中所有让一切正常工作的微小配置。希望你能帮助我。
提前谢谢。
M.
发布于 2011-10-25 17:19:17
好吧,我不知道这是否可以被认为是好的答案,但是管理员在ISA服务器上做了一些事情。所以现在它完全起作用了。
M.
https://stackoverflow.com/questions/7876133
复制相似问题