我可以弄清楚如何正确设置从单声道wsdl生成的服务引用。我在visual studio中预编译我的应用程序,自动生成webservice。当我试图自己解决这个问题时,我发现了这篇文章:Client endpoint configuration '*' was not found in 1 Endpoints
但我无法理解如何为我更改代码。 VS中生成的代码对我来说是这样的:
namespace manager.ServiceNamespace {
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ServiceModel.ServiceContractAttribute(Namespace="urn:DefaultNamespace", ConfigurationName="ServiceNamespace.BindingInterface")]
public interface BindingInterface { ... }
}
生成的app.config看起来像这样:
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BindingInterface" allowCookies="true" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" maxBufferPoolSize="2147483647">
<readerQuotas maxDepth="32" maxArrayLength="2147483647" maxStringContentLength="2147483647"/>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://example.com/webservice/soap/1.0/" binding="basicHttpBinding" bindingConfiguration="BindingInterface" contract="ServiceNamespace.BindingInterface" name="SomeName"/>
</client>
</system.serviceModel>
Mono抛出的异常说:
Client endpoint configuration '*' was not found in 0 endpoints.
我如何正确地告诉mono正确的配置?