Web References and service references

Source: Internet
Author: User

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

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.