Advertisement
Guest User

Untitled

a guest
Sep 15th, 2015
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.09 KB | None | 0 0
  1. [Tue 17:13:36] <Elles`w> I want my webservice app to have both client and server
  2. [Tue 17:13:49] <Elles`w> and I need forms for input
  3. [Tue 17:13:59] <Elles`w> is it doable in 1 project?
  4. [Tue 17:15:36] <Tavi> I don't think so. At least the forms project must be separated I guess
  5. [Tue 17:16:02] <Tavi> what type of web service do you use?
  6. [Tue 17:18:06] <Elles`w> soap
  7. [Tue 17:18:16] <Tavi> think about the service for a moment (either web api or wcf). They don't actually have an entry point, they are started and managed by IIS
  8. [Tue 17:18:27] <Tavi> somehow when the service is started you need to display your form
  9. [Tue 17:20:03] <Elles`w> yes Im allowed to add web forms
  10. [Tue 17:20:07] <Tavi> why would you want them all in a single project? it does not make very much sense
  11. [Tue 17:20:21] <Elles`w> Im coding a SAP symulator
  12. [Tue 17:20:57] <Elles`w> it will have its own server, and I want it to display the data that was called
  13. [Tue 17:21:10] * fr3aksken (~freaksken@host86-163-90-29.range86-163.btcentralplus.com) has joined #C#
  14. [Tue 17:21:19] <Elles`w> + client to send asnwers
  15. [Tue 17:21:29] <Elles`w> and I want them to be displayed too
  16. [Tue 17:23:02] <Elles`w> I want all the functions to return void
  17. [Tue 17:23:10] <Elles`w> I want to capture the data and do something with it
  18. [Tue 17:23:20] <Elles`w> display for start
  19. [Tue 17:23:27] <Tavi> ok, but why would you need it in a single project?
  20. [Tue 17:24:01] <Elles`w> how to pass this data to the form app then?
  21. [Tue 17:24:02] * freaksken (~freaksken@host86-163-90-29.range86-163.btcentralplus.com) Quit (Ping timeout)
  22. [Tue 17:24:02] * fr3aksken is now known as freaksken
  23. [Tue 17:24:06] <Tavi> it's easier, and I know for sure that you can do it in two separate projects, one for your service, and a win forms project (in which you add a service reference to the other project)
  24. [Tue 17:24:24] <Elles`w> database?
  25. [Tue 17:24:47] <Tavi> you shouldn't need a database for this
  26. [Tue 17:24:56] <Tavi> but if you do, it should be connected to the service
  27. [Tue 17:25:14] <Elles`w> nono
  28. [Tue 17:25:18] <Elles`w> the client is easy
  29. [Tue 17:25:32] <Tavi> by adding a service reference to the WinForms project, the client is auto generated for you
  30. [Tue 17:25:34] <Elles`w> this is the design
  31. [Tue 17:25:44] <Elles`w> SAP side: Server Client
  32. [Tue 17:25:52] <Elles`w> and other side: Server Client
  33. [Tue 17:26:11] <Elles`w> so you have 2 different apps
  34. [Tue 17:26:26] <Elles`w> and I want to keep these 2 sides in 1 project
  35. [Tue 17:26:38] <Elles`w> 1 project for SAP and 1 project for another side
  36. [Tue 17:26:54] <Tavi> each project with its own server and client ?
  37. [Tue 17:26:57] <Elles`w> yes
  38. [Tue 17:27:37] <Elles`w> I know that I can log everything on client side
  39. [Tue 17:27:39] <Tavi> and you want to build 2 client applications (windows forms)
  40. [Tue 17:28:35] <Elles`w> client SAP call server functions of another side and another side's client calls the server funcitons of SAP server
  41. [Tue 17:29:16] <Elles`w> and I need forms on the SAP side since I need a process start input
  42. [Tue 17:30:34] <Tavi> so the SAP client is consuming your service, and the other client is consuming the SAP service?
  43. [Tue 17:30:43] <Elles`w> yes
  44. [Tue 17:30:50] <Elles`w> thats how it works
  45. [Tue 17:30:55] <Elles`w> on the production
  46. [Tue 17:31:06] <Elles`w> I have to simulate these things
  47. [Tue 17:31:53] <Tavi> it's a lot easier to do it with 4 projects rather than 2. maybe 3 projects (2 for each service, and a single win forms project for both clients)
  48. [Tue 17:32:10] <Elles`w> yes I think I will do that with several projects
  49. [Tue 17:32:29] <Tavi> you host the web services on IIS?
  50. [Tue 17:32:37] <Tavi> or you'll go for windows services?
  51. [Tue 17:33:08] <Elles`w> we wont host
  52. [Tue 17:33:19] <Elles`w> windows
  53. [Tue 17:33:49] <Elles`w> just like all the examples on the net
  54. [Tue 17:33:53] <Elles`w> localhost
  55. [Tue 17:33:55] <Elles`w> :D
  56. [Tue 17:34:01] <Tavi> yea, by default I guess it's iis express
  57. [Tue 17:34:08] <Elles`w> probably
  58. [Tue 17:34:12] <Elles`w> Im new to the subject
  59. [Tue 17:34:19] <Tavi> but if you need them available outside the debugging mode of visual studio, you should host them on iis
  60. [Tue 17:34:46] <Elles`w> these will be only gateways for messages
  61. [Tue 17:35:12] <Tavi> yea, personally I think having 2 projects for each service, and a third win forms project is the best way to go
  62. [Tue 17:36:01] * Heisenberg (Heisenberg@bzq-84-109-68-59.cablep.bezeqint.net) Quit (Ping timeout)
  63. [Tue 17:36:05] <Elles`w> so I will ahve to think of a way to communicate with client after receiving the message in server
  64. [Tue 17:36:12] <Elles`w> sucks
  65. [Tue 17:36:24] <Tavi> heh :D that's another subject altogether
  66. [Tue 17:36:29] <Tavi> it's called duplex service
  67. [Tue 17:36:32] <Tavi> you should check it out
  68. [Tue 17:36:39] <Elles`w> thanks for your input to that matter
  69. [Tue 17:36:41] <Tavi> it's pretty easy to implement, I did it myself
  70. [Tue 17:36:49] <Tavi> duplex WCF service
  71. [Tue 17:36:56] <Tavi> search on google it should point you in the right direction
  72. [Tue 17:38:26] <Elles`w> thanks again
  73. [Tue 17:38:28] <Tavi> no problem
  74. [Tue 17:38:35] * Progman (~progman@Progman.users.quakenet.org) has joined #C#
  75. [Tue 17:38:36] <Tavi> so you need to tell the client that the message arrived?
  76. [Tue 17:38:54] <Elles`w> aye
  77. [Tue 17:39:02] <Tavi> maybe you don't need such complex thing as duplex service
  78. [Tue 17:39:08] <Tavi> you could use NLog for example
  79. [Tue 17:39:13] <Tavi> to log something in a txt file
  80. [Tue 17:39:19] <Tavi> when receiving a message
  81. [Tue 17:39:22] <Elles`w> so a database
  82. [Tue 17:39:31] <Tavi> or a database, yes
  83. [Tue 17:40:21] <Tavi> the purpose of the duplex service is far greater than confirming a message
  84. [Tue 17:40:40] <Tavi> but if you need higher level of confirmation than just writing to a text file, you can go for the duplex service
  85. [Tue 17:41:33] <Elles`w> I need to parse data and send an order to another side
  86. [Tue 17:41:51] <Tavi> so you need the services to be able to communicate between them ?
  87. [Tue 17:42:03] <Elles`w> mhm
  88. [Tue 17:42:20] <Tavi> should the communication be bidirectional?
  89. [Tue 17:42:25] <Elles`w> in cpp it was way easier
  90. [Tue 17:42:28] <Tavi> or only just one service should send data to the other?
  91. [Tue 17:42:35] <Elles`w> but I dont wanna play with soap xml in there
  92. [Tue 17:42:41] <Elles`w> thats why I decided to move to c#
  93. [Tue 17:42:45] <Tavi> absolutely
  94. [Tue 17:42:51] * Heisenberg (Heisenberg@bzq-84-109-68-59.red.bezeqint.net) has joined #C#
  95. [Tue 17:43:16] <Elles`w> just send
  96. [Tue 17:43:22] <Tavi> that's perfect
  97. [Tue 17:43:32] <Tavi> maybe you don't need the second client afterall
  98. [Tue 17:43:42] <Tavi> one client sends the data to one service
  99. [Tue 17:44:05] <Tavi> the service processes the data and sends it to the other service
  100. [Tue 17:44:15] <Tavi> is this correct?
  101. [Tue 17:44:15] <Elles`w> there is too much data to check so I could return something immediately
  102. [Tue 17:44:49] <Elles`w> service is only a gateway
  103. [Tue 17:44:57] <Elles`w> it will pass the data to the main program
  104. [Tue 17:45:02] <Elles`w> which is coded in cpp
  105. [Tue 17:45:58] <Elles`w> my plan is to take the funciton arguments, pack them to json and insert to database
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement