troubleshooting Question

Could not find default endpoint element that references conctract

Avatar of Phreak3eb
Phreak3eb asked on
Web Languages and StandardsC#
2 Comments1 Solution10887 ViewsLast Modified:
I'm trying to work with Amazon's Web Services.  I have successfully used VS2008 to create the Service Reference.  It auto generated the proxy Reference.cs and app.config files successfully.  

When I execute this line:

AWSECommerceServicePortTypeClient ecs = new AWSECommerceServicePortTypeClient();

I get the error:

Could not find default endpoint element that references contract 'AmazonWebService.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.

Here is the app.config file:

<system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="AWSECommerceServiceBinding" closeTimeout="00:01:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                    useDefaultWebProxy="true">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <security mode="None">
                        <transport clientCredentialType="None" proxyCredentialType="None"
                            realm="" />
                        <message clientCredentialType="UserName" algorithmSuite="Default" />
                    </security>
                </binding>
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://soap.amazon.com/onca/soap?Service=AWSECommerceService"
                binding="basicHttpBinding" bindingConfiguration="AWSECommerceServiceBinding"
                contract="AmazonWebService.AWSECommerceServicePortType" name="AWSECommerceServicePort" />
        </client>
    </system.serviceModel>

I have tried putting in the full namespace in the contract field as "Rodunu.Services.Amazon.AmazonWebService.AWSECommerceServicePortType" and receive the same error.

All help is appreciated.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros