The WebService prompts an endpoint configuration... Problems

Source: Internet
Author: User

Use WebService in Silverlight if you delete the same service more than twice and then add it again,ProgramAn error is reported during debugging. Error message:

 
An endpoint configuration section for contract 'servicereference1. service' could not be loaded because more than one endpoint configuration for that contract was found. Please indicate the preferred endpoint configuration section by name.

Since I have never touched the WSDL file before, I am still helpless when I report an error to the WSDL file. I directly copied this error to Google for search. Later I found that all the search results were in a WCF style and I still couldn't understand it. After a while, I read this error again.

 
Because more than one endpoint configuration for that contract was found

Indicates that multiple endpoints exist. You need to specify which endpoint to use. Refer to the solution in WCF (not listed here). So I found the configuration file in WebService (note that the configuration file. svcinfo is a suffix, rather than a WSDL file). The style displayed by WebService in vs is as follows:

View the configuration file as follows:

<? XML version = "1.0" encoding = "UTF-8"?> <Configurationsnapshot xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns: XSD = "http://www.w3.org/2001/XMLSchema" xmlns = "urn: Schemas-Microsoft-com: XML-wcfconfigurationsnapshot "> <behaviors/> <bindings> <binding digest =" system. servicemodel. configuration. basichttpbindingelement, system. servicemodel, version = 4.0.0.0, culture = neutral, publickeytoken = b77a5c561934e089: <? XML version = "1.0" encoding = "UTF-16"?> <Data maxbuffersize = "2147483647" name = "comparechartservicesoap11binding5"> <security mode = "NONE"/> </data> "bindingtype =" basichttpbinding "name =" comparechartservicesoap11binding5 "/> /bindings> <endpoints> <endpoint normalizeddigest = "<? XML version = "1.0" encoding = "UTF-16"?> <Data address = "http: // localhost: 8080/axis2/services/comparechartservice" binding = "basichttpbinding" bindingconfiguration = "comparechartservicesoap11binding5" Contract = "comparechartservice. comparechartserviceporttype "name =" comparechartservicehttpsoap11endpoint5 "/>" Digest = "<? XML version = "1.0" encoding = "UTF-16"?> <Data address = "http: // localhost: 8080/axis2/services/comparechartservice" binding = "basichttpbinding" bindingconfiguration = "comparechartservicesoap11binding5" Contract = "comparechartservice. comparechartserviceporttype "name =" comparechartservicehttpsoap11endpoint5 "/>" contractname = "comparechartservice. comparechartserviceporttype "name =" comparechartservicehttpsoap11endpoint5 "/> </endpoints> </configurationsnapshot>

This file is okay. To solve this error, you must specify a parameter for the constructor when declaring the endpoint.

The default constructor is used.

 
Serviceendpoint Ep = new PAS. i1service. comparechartservice. comparechartserviceporttypeclient (). endpoint;

Specify the endpoint name in the constructor.

 
Serviceendpoint Ep = new PAS. i1service. comparechartservice. comparechartserviceporttypeclient ("comparechartservicehttpsoap11endpoint5"). endpoint;

From this error, I found that many new errors have never been touched by. At this time, do not rush to search for a solution, but fully understand what the error is. In this way, the efficiency of solving errors will be higher!

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.