One, how to generate a server certificate in IIS 7.0, and require the Web site to be accessed in HTTP for reference:
Http://www.cnblogs.com/chnking/archive/2008/10/07/1305811.html
Make sure the certificate name is exactly the same as the server name.
Ii. WCF Application Authoring
1. "New Project"---WCF Service Application;
2. Modify the service interface and service class, generate;
3. If security is not taken into account, the client can call it if it is published directly here;
Third, WCF Service configuration Editor
1. Use the WCF Service Configuration Editor to open the program's web. config
2. Create a new "service":
(1) Select the generated ". dll"
(2) There are several modes of communication: TCP, HTTP, Named Pipes, MSMQ, peers (Point-to-point),
(3) The operation of basic Web services is not considered;
(4) Endpoint address (can not be filled, may need to look at this specific configuration later)
3. Create a new "binding":
(1) BasicHttpBinding
(2) Switch to "security"
(3) mode select "Transport" and then set the Transportclientcredentialtype in the Transportsecurity property to "none"
4. Service behavior in the advanced:
(1) Give a name: namespace. ServiceBehavior (not fixed, just think this writing is very normative);
(2) for "servicemetadata" meta data, set "Httpgetenabled=false,httpsgetenabled=true",
(3) Apply Service behavior settings, select the service set in step 2, "behaviorconfiguration" in the name set for (1), "bindingconfiguration" in the "endpoint" to
Select the name of the binding in step 3
5. Publish to WCF:
6. Test the WCF service with https:
The only thing to note is that localhost replaces the cost machine name
7. Build the client using Add Service reference or svcutil, provided that the Iis_user user has permission to the C:\Windows\Temp directory
8. After generating the client:
String url = "Https://myeggsoft/MyWcfService/DataService.svc";
BasicHttpBinding mybinding = new BasicHttpBinding (); MyBinding.Security.Mode = Basichttpsecuritymode.transport; MyBinding.Security.Transport.ClientCredentialType = Httpclientcredentialtype.none; EndpointAddress address = new endpointaddress (URL); Servicereference1.dataserviceclient client = new Servicereference1.dataserviceclient (mybinding, address)
......
Note: This log was modified from: http://www.cnblogs.com/bearhb/archive/2012/07/02/2573236.html
WCF is published to IIS 7.0 and is accessed with HTTPS