我谈两个问题,但我认为在某些方面存在着联系。
我做了发言。 休息服务,有NET4,只见https。 在我的地方,一切都是ok。
Now I deployed it to a hosting provider. For what I know all the requests go through an ISA server.
起初,它没有工作。 我做了很多尝试,但我总是看不到第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.
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.
提前感谢。
M.