App.config没有生成

时间:2015-08-17 09:17:13

标签: c# binding app-config endpoint-address

我在.NET visual studio代码中添加了一个服务引用(https://cawc-test.crm.ap2.oraclecloud.com/mklLeads/SalesLeadService?WSDL)。但它没有生成app.config文件。我也尝试在visual studio命令提示符下使用svcutil.exe。我还尝试取消选中引用程序集中的' Resuse类型'在添加服务引用时单击“高级”按钮。但仍然没有生成App.config文件。

client = new SalesLeadServiceClient();
_client.ClientCredentials.UserName.UserName = " ";
_client.ClientCredentials.UserName.Password = " ";

EndpointAddress endPointAddr = new EndpointAddress(address);
BasicHttpBinding binding = new BasicHttpBinding(BasicHttpSecurityMode.TransportWithMessageCredential);
binding.Security.Message.ClientCredentialType = BasicHttpMessageCredentialType.UserName;
_client = new SalesLeadServiceClient(binding, endPointAddr);
BindingElementCollection elements = _client.Endpoint.Binding.CreateBindingElements();
elements.Find<SecurityBindingElement>().IncludeTimestamp = false;
_client.Endpoint.Binding = new CustomBinding(elements);
igcomp.PrepareConnectSession(_client.ChannelFactory);

我在班上添加了以下代码。但它仍然无法找到引用合同的默认端点元素&#39;。

如果有人能就此提出任何解决方案,我们将不胜感激?

0 个答案:

没有答案