我有两个问题,但我认为在某种程度上存在联系。
我使用.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>所以我尝试了很多东西,但最后我做到了。 我到处都是一个名字。 在行为标记中,绑定和standardendpoint标记。 有用 !! 好的,差不多。 现在我的所有结果都是XML格式。 我没有json。 即使fiddler使用“Accept:application / json”或“Accept:text / json”这一行,它总是以XML格式显示。 即使我将automaticFormatSelectionEnabled设置为false。 并在URL中添加“帮助”,例如“https:// mydomainname / items / help”我收到了“未找到端点”
所以,现在我迷路了,因为我不了解WCF中的所有微小配置,以使一切正常。 希望您能够帮助我。
提前致谢。
M.
I got two questions, but I think that there linked in someways.
I made an WCF Rest service, with .NET4, and only on https. On my local pc, everything is ok.
Now I deployed it to a hosting provider. For what I know all the requests go through an ISA server.
At first, it didn't worked. I tried a lot, but I always got the error 404, resource not found. The specific error is :
[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.First thing I saw is that the URL in the exception is not https. OK, strange, because my web.config is :
<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>So I tried a lot of things but at the end I made it works. I just put a name everywhere. In the behavior tag, the binding and standardendpoint tag. IT WORKS !! OK, almost. Now all my results are in XML format. I got no json. Even with fiddler with the line "Accept: application/json" or "Accept: text/json" it always in XML. Even if I put the automaticFormatSelectionEnabled to false. And adding the "Help" to the URL, like "https://mydomainname/items/help" I got a "Endpoint not found"
So, now I'm lost, as I don't understand all the tiny configuration in WCF to make everything work. Hope you can help me.
Thanks in advance.
M.
最满意答案
好吧,我不知道它是否可以被认为是一个好的答案,但管理员在ISA服务器上做了一些事情。 所以现在它完全正常工作。
M.
OK, I don't know if it can be considered as the good answer but admin made something on ISA server. So now it's fully working.
M.
更多推荐
发布评论