by Viper
1. February 2009 20:43
I am working on an API to consume Amazon.com web services to search product. Previously I had consumed Amazon.com web services as a web reference. This time I decided to use .Net 3.5 WCF service reference for this web service. After implementing a simple book search API, I wrote a console application to test it out. As soon as the library tried to create instance of web service client, I got the following error.
Could not find default endpoint element that references contract 'AmazonData.AWSECommerceServicePortType' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.
I looked at the consuming application's BIN folder. I did not see any configuration file. Then I looked at BIN folder of my class library. I found that ServiceModel Metadata Utility Tool (Svcutil.exe) generated app.config file in the project and it got compiled into MyApi.dll.config. This configuration contains binding, endpoint etc. definitions that default constructor of AWSECommerceServicePortTypeClient object was looking for. There are couple of options you have to fix this problem.
|
|
|
b13a4dcf-5920-4d92-befb-835a186dbe0d|0|.0
Views: 13509
Tags: wcf
WCF