Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public AdminClient()
- {
- ChannelFactory<IProductAdmin> factory = new ChannelFactory<IProductAdmin>();
- productAdminChannel = factory.CreateChannel();
- }
- <system.serviceModel>
- <client>
- <endpoint address="net.tcp://localhost:8002/ProductBrowser"
- binding="netTcpBinding"
- contract="Contracts.IProductAdmin" />
- </client>
- </system.serviceModel>
- public AdminClient()
- {
- var fac = new ChannelFactory<IProductAdmin>("admin");
- productAdminChannel = fac.CreateChannel();
- }
- <system.serviceModel>
- <client>
- <endpoint name="admin"
- address="net.tcp://localhost:8002/ProductBrowser"
- binding="netTcpBinding"
- contract="Contracts.IProductAdmin" />
- </client>
- </system.serviceModel>
- public AdminClient()
- {
- ChannelFactory<IProductAdmin> factory
- = new ChannelFactory<IProductAdmin>("*");
- productAdminChannel = factory.CreateChannel();
- }
- using System;
- using System.ServiceModel;
- namespace CoDeMagazine.ServiceArticle
- {
- public class ProductClient
- : ClientBase<IProductBrowser>,
- IProductBrowser
- {
- #region IProductBrowser Members
- public ProductData GetProduct(
- Guid productID)
- {
- return Channel.GetProduct(productID);
- }
- public ProductData[] GetAllProducts()
- {
- return Channel.GetAllProducts();
- }
- public ProductData[] FindProducts(
- string productNameWildcard)
- {
- return Channel.FindProducts(
- productNameWildcard);
- }
- #endregion
- }
- }
- public AdminClient()
- {
- ChannelFactory<IProductAdmin> factory =
- new ChannelFactory<IProductAdmin>(string.Empty);
- productAdminChannel = factory.CreateChannel();
- }
Add Comment
Please, Sign In to add comment