- firstwcfserviceclientconsoleapp.zip
- FirstWcfII7Host
- _vti_cnf
- _vti_pvt
- access.cnf
- deptodoc.btr
- doctodep.btr
- linkinfo.btr
- service.cnf
- service.lck
- services.cnf
- structure.cnf
- _vti_script
- _vti_txt
- App_Code
- _vti_cnf
- App_Data
- Bin
- _vti_cnf
- FirstWcfService.dll
- FirstWcfService.dll.refresh
- FirstWcfService.pdb
- FirstWcfService.dll
- FirstWcfService.dll.refresh
- FirstWcfService.pdb
- Service.svc
- Web.config
- FirstWcfIIS6Host
- App_Code
- App_Data
- Bin
- FirstWcfService.dll
- FirstWcfService.pdb
- Service.svc
- Web.config
- FirstWcfService.sln
- FirstWcfService
- FirstWcfServiceClientConsoleApp
- FirstWcfServiceHostConsoleApp
- FirstWcfServiceWindowsServiceHost
|
//Program.cs
using System;
using System.Collections.Generic;
using System.Text;
using System.ServiceModel;
//using System.ServiceModel.Channels;
using System.ServiceModel.Description;
namespace FirstWcfServiceHostConsoleApp
{
class Program
{
static void Main(string[] args)
{
#region This code for svcutil.exe generation
/*NetTcpBinding tcp = new NetTcpBinding();
string adresse = "Service";
Uri baseNetTcpAddress = new Uri("net.tcp://localhost:9000/FirstWcfService");
ServiceHost host = new ServiceHost(typeof(FirstWcfService.Service), new Uri[] { baseNetTcpAddress });
ServiceMetadataBehavior metadataBehavior = new ServiceMetadataBehavior();
host.Description.Behaviors.Add(metadataBehavior);
System.ServiceModel.Channels.Binding mexTcpBinding = System.ServiceModel.Description.MetadataExchangeBindings.CreateMexTcpBinding();
host.AddServiceEndpoint(typeof(IMetadataExchange), mexTcpBinding, "mex");
host.AddServiceEndpoint(typeof(FirstWcfService.IService), tcp, adresse);*/
#endregion
#region Hosting a service programatically
// Uri baseNetTcpAddress = new Uri("net.tcp://shomou:9000/");
// using (ServiceHost host = new ServiceHost(typeof(FirstWcfService.Service), baseNetTcpAddress))
//{
// host.AddServiceEndpoint(typeof(FirstWcfService.IService), new NetTcpBinding(), "FirstWcfService");
// ServiceDebugBehavior metadataBehavior;
// metadataBehavior = host.Description.Behaviors.Find<ServiceDebugBehavior>();
// if (metadataBehavior == null)
// {
// metadataBehavior = new ServiceDebugBehavior();
// metadataBehavior.IncludeExceptionDetailInFaults = true;
// host.Description.Behaviors.Add(metadataBehavior);
// }
// host.Open();
// Console.WriteLine("Press <Enter> to terminate the Host application.");
// Console.WriteLine();
// Console.ReadLine();
//}
#endregion
#region Hosting a service by a config file
using (ServiceHost host = new ServiceHost(typeof(FirstWcfService.Service)))
{
host.Open();
Console.WriteLine("Press <Enter> to terminate the Host application.");
Console.ReadLine();
}
#endregion
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I'm un IT Consultant (with B. Sc. and M. Sc. Background in Civil Engineering - university of Baghdad). I'm specialized in Microsoft products (ASP.NET, C#, WCF, Ajax.NET, VB.NET, and IIS) and also I'm familiar with various platforms and technologies (XML-XSL, SOA, Java, ORACLE). Good knowledge in n-tiers design and development using Object-Oriented Programming (OOP) methodologies.
I enjoy working on my own initiative as well as being part of a team. Well organized with a determination to succeed in all areas of work to be undertaken. I communicate effectively in four languages (English, French, Arab, Chaldean) in a cross-cultural environment. Currently I am working with Apside as an Senior IT Engineer in France.
Feel free to mail me for anything at fshomou AT hotmail Dot com.