Insecure Intranet clients and services
The following illustration describes a simple Windows Communication Foundation (WCF) service, which is developed to provide information about the secure private network to WCF applications. Security is not required in the following situations: low data importance, network security in essence, or security is provided at the underlying layer of the WCF infrastructure.
| Features |
Description |
|
Security Mode |
None |
|
Transmission |
TCP |
|
Bind |
NetTcpBinding |
|
Interoperability |
Only WCF |
|
Authentication |
None |
|
Integrity |
None |
|
Confidentiality |
None |
Service
The following code and configuration will run independently. Perform one of the following operations:
- Use code instead of configuration to create an independent service.
- Use the provided configuration to create the service, but do not define any endpoints.
Code
The following code demonstrates how to create an insecure endpoint:
Configuration
The following code uses the configuration to set the same endpoint:
<?xml version="1.0" encoding="utf-8"?><configuration> <system.serviceModel> <behaviors /> <services> <service behaviorConfiguration="" name="ServiceModel.Calculator"> <endpoint address="net.tcp://localhost:8008/Calculator" binding="netTcpBinding" bindingConfiguration="tcp_Unsecured" name="netTcp_ICalculator" contract="ServiceModel.ICalculator" /> </service> </services> <bindings> <netTcpBinding> <binding name="tcp_Unsecured"> <security mode="None" /> </binding> </netTcpBinding> </bindings> <client /> </system.serviceModel></configuration>
Client
The following code and configuration should be run independently. Perform one of the following operations:
- Use Code (and client code) to create an independent client.
- Create a client that does not define any endpoints. Use the client constructor that uses the configuration name as the parameter. For example:
Code
The following code demonstrates a basic WCF client that uses the TCP protocol to access insecure endpoints.
Configuration
The following configuration Code applies to the client:
<?xml version="1.0" encoding="utf-8"?><configuration> <system.serviceModel> <bindings> <netTcpBinding> <binding name="NetTcpBinding_ICalculator" > <security mode="None"> </security> </binding> </netTcpBinding> </bindings> <client> <endpoint address="net.tcp://machineName:8008/Calculator " binding="netTcpBinding" bindingConfiguration="NetTcpBinding_ICalculator" contract="ICalculator" name="NetTcpBinding_ICalculator" /> </client> </system.serviceModel></configuration>