Security issues of HTTP Services in WCF under Vista

Source: Internet
Author: User
HTTP service security questions about WCF in Vista:

Security issues of HTTP Services in WCF under Vista

Today, a wcf tcp program is developed under Vista and runs normally,
I suddenly wanted to expose the HTTP interface. According to the instructions in the WCF documentation, there should be no problem, but it is very pleasant to say.
The service process does not have the permission to open the port. The specific error message is similar:
System. servicemodel. addressaccessdeniedexception: HTTP cannot register URL http: // +: 8000/servicemodelsamples/service /. The process does not have access to this namespace (for more information, see http://go.microsoft.com/fwlink? Linkid = 70353 ). ---> System. net. httplistenerexception: Access Denied

Msdn provides three steps to solve this problem:
1. If the computer is not a domain member, set the Authentication Mode and protection level to none to disable Transmission security, as shown in the following example:
Make sure that the end point is associated with the binding by setting the bindingconfiguration attribute of the end point.

Make sure that the configuration on the pythonmessageserver, server, and client is changed before running the example.

2. Note:
Setting security mode to none is equivalent to setting msmqauthenticationmode, msmqprotectionlevel, and message security to none.

3. To enable metadata exchange to work properly, register a URL with the HTTP binding. This requires the service to run in the Command window with elevated permissions. Otherwise, you will receive an exception

At last, I opened the program as an administrator to register the URL. It seems that Vista is indeed highly secure. I don't know how to write this program to run smoothly under Vista.

In addition, I tested the performance differences between the TCP protocol and the basichttp protocol:
The difference between the two is not very big:
Both the service and client programs are on one server (Vista)
500 calls in TCP mode, about 600 milliseconds
500 calls in http mode, about 800 milliseconds

Overall, HTTP is less than 30% slower than TCP, And it is acceptable
Of course this is on the local machine. If it is running on the public network, it is not so optimistic. It takes a little more than 1 millisecond to complete the call. Amazing!

See the complete service configuration for your reference:
<System. servicemodel>
<Services>
<Service name = "serverpart. Server" behaviorconfiguration = "SB">
<Host>
<Baseaddresses>
<Add baseaddress = "net. TCP: // 127.0.0.1: 5353"/>
<Add baseaddress = "http: // 127.0.0.1: 5356/"/>
</Baseaddresses>
</Host>
<Endpoint address = "Net" binding = "nettcpbinding" bindingconfiguration = "BD" Contract = "serverpart. iServer"/>
<Endpoint address = "httpend" binding = "basichttpbinding" Contract = "serverpart. iServer" bindingconfiguration = "httpbd"/>
<Endpoint address = "mex" binding = "mextcpbinding" Contract = "imetadataexchange"/>
<Endpoint address = "mex" binding = "mexhttpbinding" Contract = "imetadataexchange"/>
</Service>
</Services>
<Bindings>
<Nettcpbinding>
<Binding name = "BD">
</Binding>
</Nettcpbinding>
<Basichttpbinding>
<Binding name = "httpbd">
<Security mode = "NONE"/>
</Binding>
</Basichttpbinding>
</Bindings>
<Behaviors>
<Servicebehaviors>
<Behavior name = "SB">
<Servicemetadata/>
<! -- <Servicemetadata httpgetenabled = "true"/> -->
<Servicedebug includeexceptiondetailinfaults = "true"/>
</Behavior>
</Servicebehaviors>
</Behaviors>
</System. servicemodel>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.