What should I specify in “endpointConfigurationName” parameter of DuplexClientBase constructor ?
No matter what I put there client throws execption that says “Could not find default endpoint element that references contract ‘ServiceReference1.IClientFulfillmentPipeService’ in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.”
I generated proxy using “Add Service Reference” wizard. Here is source code of the client:
class Program
{
static void Main()
{
try
{
var client = new ClientFulfillmentPipeServiceClient(new InstanceContext(new Wrapper()), "*", "net.tcp://localhost:9000/svc");
client.Initialize(1234, "Test");
client.Close();
}
catch (Exception ex)
{
Debug.WriteLine(ex.Message);
}
}
}
And I have sample WCF server written as console application. Here is the implementation:
static void Main()
{
UiWcfSession.OnInitialize += ClientInitialize;
var baseAddresses = new Uri("net.tcp://localhost:9000/");
var host = new ServiceHost(typeof(UiWcfSession), baseAddresses);
var reliableSession = new ReliableSessionBindingElement { Ordered = true, InactivityTimeout = TimeSpan.MaxValue };
var binding =
new CustomBinding(reliableSession, new TcpTransportBindingElement()) { ReceiveTimeout = TimeSpan.MaxValue };
host.AddServiceEndpoint(typeof(IClientFulfillmentPipeService), binding, "svc");
var metadataBehavior = new ServiceMetadataBehavior();
host.Description.Behaviors.Add(metadataBehavior);
var mexBinding = MetadataExchangeBindings.CreateMexTcpBinding();
host.AddServiceEndpoint(typeof(IMetadataExchange), mexBinding, "mex");
host.Open();
Thread.CurrentThread.Join();
}
private static void ClientInitialize(int uiprocessid, string key)
{
Debug.WriteLine("ClientInitialize");
}
I’m not using xml configs.
Could you please help me ?
Looks like I can’t use this constructor unless I add .xml config file.
I ended up using another one which takes
CustomBindingandEndpointAddressas parameters.