Could not find endpoint element with name 'xxxxx' and contract 'yyy' in the ServiceModel client configuration section

无人久伴 提交于 2019-12-05 13:18:46

solved with the following-
endptAddress = new EndpointAddress(new Uri("uri"/xxxx"), EndpointIdentity.CreateDnsIdentity("xxxxxx"), addressHeaders);

MHSClient serviceProxy = new MHSClient(b, endptAddress);

@Guanxi gave me the clue when asking about endpoint address from the config file.
Once I created the endpoint address then I could instantiate/create the service using the correct overload;
var b = new CustomBinding() as the first argument and for the second argument,
the correct endpoint address.

complicated - WS-Security - IBM Websphere server interop <-> wcf client
within the context of various .NET and Visual Studio implementations of web services...
oh my

You probably need to set the ConfigurationName property of the ServiceContractAttribute above the service contract interface, ConfigurationName should match your contract name.

'VB.NET:
Imports System.ServiceModel

<ServiceContract([Namespace]:="http://yournamespace", ConfigurationName:="MHS")> _
Public Interface MHS

//C#:
using System.ServiceModel;

[ServiceContract(Namespace="http://yournamespace", ConfigurationName="MHS")]
public interface MHS

Look at the auto generated code here: MSDN: How to: Create a Windows Communication Foundation Client

Also worth looking at: MSDN: ServiceContractAttribute Class

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!