Home > Uncategorized > More than one endpoint configuration for that contract was found

More than one endpoint configuration for that contract was found

In VS 2008, when you add a web refrence to a windows forms app, it works a little differently, createing a "service" reference. This causes
some problems with web services that have more than one binding, i.e. designed to support Soap 1.0 and Soap 1.2.

This was the first sign of this nasty quirk;
An endpoint configuration section for contract ‘FreebieSMSWebservice.BulkSMSSoap’ could not be loaded because more than one endpoint configuration for that contract was found. Please indicate the preferred endpoint configuration section by name.

If you open the Configuration.svcinfo file, then scroll to the end right, you’ll see the xml (below). Where I’ve highlighted the endpoint names;
So then the client code becomes:

            BulkSMSSoapClient SMS = new BulkSMSSoapClient("BulkSMSSoap");
            double dCredit = SMS.GetRemainingCredit("xxxx", "xxxx");
            MessageBox.Show(dCredit.ToString());

Where the parameter sent to the constructor is the endpoint name.

<?xml version="1.0" encoding="utf-8"?>
<configurationSnapshot xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd="http://www.w3.org/2001/XMLSchema&quot; xmlns="urn:schemas-microsoft-com:xml-wcfconfigurationsnapshot">
  <behaviors />
  <bindings>
    <binding digest="System.ServiceModel.Configuration.BasicHttpBindingElement, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089:&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt;&lt;Data hostNameComparisonMode=&quot;StrongWildcard&quot; maxBufferSize=&quot;65536&quot; messageEncoding=&quot;Text&quot; name=&quot;BulkSMSSoap&quot; textEncoding=&quot;utf-8&quot; transferMode=&quot;Buffered&quot;&gt;&lt;readerQuotas maxArrayLength=&quot;16384&quot; maxBytesPerRead=&quot;4096&quot; maxDepth=&quot;32&quot; maxNameTableCharCount=&quot;16384&quot; maxStringContentLength=&quot;8192&quot; /&gt;&lt;security mode=&quot;None&quot;&gt;&lt;message algorithmSuite=&quot;Default&quot; clientCredentialType=&quot;UserName&quot; /&gt;&lt;transport clientCredentialType=&quot;None&quot; proxyCredentialType=&quot;None&quot; realm=&quot;&quot; /&gt;&lt;/security&gt;&lt;/Data&gt;" bindingType="basicHttpBinding" name="BulkSMSSoap" />
    <binding digest="System.ServiceModel.Configuration.CustomBindingElement, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089:&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt;&lt;Data name=&quot;BulkSMSSoap12&quot;&gt;&lt;httpTransport allowCookies=&quot;false&quot; authenticationScheme=&quot;Anonymous&quot; bypassProxyOnLocal=&quot;false&quot; hostNameComparisonMode=&quot;StrongWildcard&quot; keepAliveEnabled=&quot;true&quot; manualAddressing=&quot;false&quot; maxBufferPoolSize=&quot;524288&quot; maxBufferSize=&quot;65536&quot; maxReceivedMessageSize=&quot;65536&quot; proxyAuthenticationScheme=&quot;Anonymous&quot; realm=&quot;&quot; transferMode=&quot;Buffered&quot; unsafeConnectionNtlmAuthentication=&quot;false&quot; useDefaultWebProxy=&quot;true&quot; /&gt;&lt;textMessageEncoding maxReadPoolSize=&quot;64&quot; maxWritePoolSize=&quot;16&quot; messageVersion=&quot;Soap12&quot; writeEncoding=&quot;utf-8&quot;&gt;&lt;readerQuotas maxArrayLength=&quot;16384&quot; maxBytesPerRead=&quot;4096&quot; maxDepth=&quot;32&quot; maxNameTableCharCount=&quot;16384&quot; maxStringContentLength=&quot;8192&quot; /&gt;&lt;/textMessageEncoding&gt;&lt;/Data&gt;" bindingType="customBinding" name="BulkSMSSoap12" />
  </bindings>
  <endpoints>
    <endpoint normalizedDigest="&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt;&lt;Data address=&quot;http://www.freebiesms.co.uk/bulksms.asmx&quot; binding=&quot;basicHttpBinding&quot; bindingConfiguration=&quot;BulkSMSSoap&quot; contract=&quot;FreebieSMSWebservice.BulkSMSSoap&quot; name=&quot;BulkSMSSoap&quot; /&gt;" digest="&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt;&lt;Data address=&quot;http://www.freebiesms.co.uk/bulksms.asmx&quot; binding=&quot;basicHttpBinding&quot; bindingConfiguration=&quot;BulkSMSSoap&quot; contract=&quot;FreebieSMSWebservice.BulkSMSSoap&quot; name=&quot;BulkSMSSoap&quot; /&gt;" contractName="FreebieSMSWebservice.BulkSMSSoap" name="BulkSMSSoap" />
    <endpoint normalizedDigest="&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt;&lt;Data address=&quot;http://www.freebiesms.co.uk/bulksms.asmx&quot; binding=&quot;customBinding&quot; bindingConfiguration=&quot;BulkSMSSoap12&quot; contract=&quot;FreebieSMSWebservice.BulkSMSSoap&quot; name=&quot;BulkSMSSoap12&quot; /&gt;" digest="&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt;&lt;Data address=&quot;http://www.freebiesms.co.uk/bulksms.asmx&quot; binding=&quot;customBinding&quot; bindingConfiguration=&quot;BulkSMSSoap12&quot; contract=&quot;FreebieSMSWebservice.BulkSMSSoap&quot; name=&quot;BulkSMSSoap12&quot; /&gt;" contractName="FreebieSMSWebservice.BulkSMSSoap" name="BulkSMSSoap12" />
  </endpoints>
</configurationSnapshot>

Advertisements
Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: