Original: Web references and service references
When you develop a C # WinForm program or WPF in a VS2010 environment, you encounter the problem of invoking a Web reference.
1. When a service reference is added, the BasicHttpBinding and custombinding two nodes are generated in app. Config, and in these two node forces the binding of the service reference is generated separately,
Of course the corresponding in the client node, for each service reference will generate two endpoint
This causes the prompt to be called when
Error: Failed to load the endpoint configuration portion of the contract as "Servicereference1.inetbankupdateservice" because multiple endpoint configurations for the contract were found. Please indicate the preferred endpoint configuration section by name.
The solution is to remove one of the two endpoint in the client.
Note: In fact, the service reference here is specifically a WCF service, but in order to be compatible with WebService, the Web reference can also be added as a service reference. Only the word "soap" is added to the server after the call.
2. Add a Web reference, which is webservice. This is very simple, after adding a direct call on the line.
Differences in usage of 3.WEB references and service references
The Add Web reference is the content in. net2.0 or 1.0. When you add a service reference. net3.0 and above are features. In 3.0, Web references can be added as service references. Of course, when adding a service reference, you can also go to the Advanced configuration and add a Web reference.
Web References and service references