开发者

Expose webHttpBinding endPoint in Framework 4.0?

开发者 https://www.devze.com 2023-01-18 06:31 出处:网络
I\'m trying to expose a webHttpBinding E开发者_Python百科ndPoint using Framework 4.0. <endpoint address=\"web\" binding=\"webHttpBinding\" contract=\"MyContract\"/>

I'm trying to expose a webHttpBinding E开发者_Python百科ndPoint using Framework 4.0.

<endpoint address="web" binding="webHttpBinding" contract="MyContract"/>

However, when browsing using WFC Test Client, I see nothing. If I change my Framework target to 3.5, it works fine.

Is there something different in 4.0 to get this to work?


First of all WCF Test Client is for testing SOAP endpoints, it is not able to use REST endpoints (webHttpBinding).

Edit:

.NET 3.5 handled REST services incorrectly and added these endpoints to WSDL. But generated proxies (even in WCF Test Client) usually didn't work because WSDL is not able to describe HTTP Verbs and other REST specific features needed to call operation. .NET 4.0 doesn't include web endpoints to WSDL (and that is the reason why endpoints are not visible in WCF Test client).


Have a look here:

http://msdn.microsoft.com/en-us/library/w4atty68.aspx

You need to put this

<configuration>
<startup>
<supportedRuntime version="v4.0" />
</startup>
</configuration>
0

精彩评论

暂无评论...
验证码 换一张
取 消