Quantcast
Channel: Question and Answer » web-services
Viewing all articles
Browse latest Browse all 136

Could not find default endpoint element that references contract 'LabM_Service.Service1Soap' in the ServiceModel client configuration section

$
0
0

I have a referenced web service in an InfoPath form that I’m trying to initialise. The service is named Service1 by default within the solution.
I’m trying to understand what I’m missing when I run the line:

   LabM_Service.Service1SoapClient svc = new LabM_Service.Service1SoapClient();

Error:

Could not find default endpoint element that references contract
‘LabM_Service.Service1Soap’ in the ServiceModel client configuration
section

The app.config contains:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="Service1Soap" />
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://10.0.0.23:9800/labm/SageConnection.asmx"
                binding="basicHttpBinding" bindingConfiguration="Service1Soap"
                contract="LabM_Service.Service1Soap" name="Service1Soap" />
        </client>
    </system.serviceModel>
</configuration>

What am I missing here?


Viewing all articles
Browse latest Browse all 136

Trending Articles