Hosting the Service and Publishing

Posted by Krishnamanohar under WCF on 11/15/2012 | Points: 10 | Views : 1026 | Status : [Member] | Replies : 1
Hi All,
i Created The Wcf Service .then what is the procedure to use it and how tohost the wcf service and Publish it?
Please Explain me with examples
Regards ,
Krishna Manohar




Responses

Posted by: Kundan64 on: 11/30/2012 [Member] Starter | Points: 25

Up
0
Down
Publish your web application with WCF service (.svc), and for consume the service Methods in your cs file, create a Method for get the Client of service -
 public static ServiceClient GetServiceInstance()

{
System.ServiceModel.BasicHttpBinding binding = new BasicHttpBinding(
Application.Current.Host.Source.Scheme.Equals("https", StringComparison.InvariantCultureIgnoreCase)
? BasicHttpSecurityMode.Transport : BasicHttpSecurityMode.None);
binding.MaxReceivedMessageSize = int.MaxValue;
binding.MaxBufferSize = int.MaxValue;
binding.CloseTimeout = new TimeSpan(0, 10, 00);
binding.OpenTimeout = new TimeSpan(0, 10, 00);
binding.ReceiveTimeout = new TimeSpan(0, 10, 00);
binding.SendTimeout = new TimeSpan(0, 10, 00);
binding.TransferMode = TransferMode.StreamedResponse;

return new ServiceClient(binding, new EndpointAddress(
new Uri(Application.Current.Host.Source, "../Service.svc")));
}

and then
ServiceClient clinet = GetServiceInstance();

client.YourMethodName(.............


Krishnamanohar, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response