我正在尝试添加网络服务。
这是我的配置文件
<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>
这是我调用 Web 服务的控制器。
ServiceReference1.Service1Soap hs = new ServiceReference1.Service1SoapClient();
int aa = hs.getStockQty(66);
但是有错误..
我该如何解决?谢谢。