I’m try to add web services.
This is my config file
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="Service1Soap" 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://localhost:51272/Service1.asmx" binding="basicHttpBinding"
bindingConfiguration="Service1Soap" contract="ServiceReference1.Service1Soap"
name="Service1Soap" />
</client>
</system.serviceModel>
This is my controller where I call the web services.
ServiceReference1.Service1Soap hs = new ServiceReference1.Service1SoapClient();
int aa = hs.getStockQty(66);
But there is error..

How can I solve it??
Thanks.
I think the endpoint has more than one references , could you please delete the reference and add it again with a different name.
if not the solution is simple. Copy the endpoint definitions from the config file ) of the class library to the config file of the application.
also check the namespace of this contract “Service1Soap”