Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace DatabaseTransferViaWcf
- {
- [ServiceContract]
- public interface IService1
- {
- [OperationContract]
- int generateId();
- }
- }
- namespace DatabaseTransferViaWcf
- {
- public class Service1 : IService1
- {
- public int generateId()
- {
- return 5700 ;
- }
- }
- }
- public partial class Transfer : Window
- {
- private void button9_Click(object sender, RoutedEventArgs e)
- {
- ServiceHost host = null;
- try
- {
- using (ServiceHost host = new ServiceHost(typeof(SendRecieveData.Service1)))
- {
- host.Open();
- Console.WriteLine("The service is ready.");
- Console.WriteLine("Press <enter /> to terminate service.");
- Console.ReadLine();
- }
- wcfHostId = wcf.generateId();
- textBox5.Text = "" + wcfHostId;
- }
- catch (Exception ex)
- {
- MessageBox.Show("Error = " + ex.Message);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement