Project situation: C # class Library project referenced the Webservice,web layer call class library, the returned JSON results are displayed in the Web interface
A service reference was added to the class library named: Xsystemwebservice, which is used in code:
Xsystemwebservice.xsystemwebservicesoapclient r = new Xsystemwebservicesoapclient ();
string result = R.returndocstatus (DocID);
Error during debugging: In the ServiceModel Client configuration section, the default endpoint element for the reference contract "..." is not found. This could be because the application's configuration file was not found, or because the endpoint element in the client element could not be found to match this contract
Cause: ServiceModel does not have a related definition in Web. config.
Workaround: Referencing WebService in the class library will automatically generate the app. Config file, which defines the <system.serviceModel> node. Copy the node information in Web. config.
Result: Debug succeeded.
C # project references WebService, prompting for an error "reference contract not found in the ServiceModel Client configuration section ..."