c# - Designing a WCF Service properly -
i need create wcf service @ work handle request different clients on same machine , optionally clients different machine on company's network (from programmer computer - debugging purposes). need suggestions on how create service because quite beginner when comes wcf.
the service requests clients perform different operations on h/w devices located on host machine. service need contain several modules support kinds of h/w devices. programmers writing client code use modules objects perform operations. each module needs support events towards clients , exception throwing.
i wanted know several things:
- is possible somehow export methods documentation clients? because best, when client code being written, programmer able see method does, exceptions being thrown , on. saw there way share api dll clients (keep in mind of clients run (and coded) on same machine using .net.
- is possible throw exceptions in service implementation methods? want use of .net abilities , exceptions 1 of them :)
- the service handle requests different threads in every client, possible use threads information (like thread id) or other way in order perform locking mechanism? example, if 2 threads of same client using same h/w device channel second 1 blocked until first 1 finished.
- finally, wanted know best endpoints , configuration service?
i know lot, read basics , can't quite decide proper way achieve these requirements.
thanks in advance.
1 - yes. said, can share api dll, plus can use mex endpoint provide documentation on service: https://social.msdn.microsoft.com/forums/vstudio/en-us/3def9d4f-ae3e-468b-90e6-3a069bac6376/when-to-use-wcf-mex-endpoint
2 - yes. wcf throws , sends faultexception
client whenever goes bad , not caught inside own app.
3 - clients run in own threads or in thread pool (i don`t remember exactly, shouldn't matter anyway). can still use multi-threading features clients no problems. wcf thread-safe, client wise. abstracts in order make looks runs entire dedicated application each user.
4 - application going web or desktop? in case going web, recommend using nethttpbinding
reliability. in case going desktop, have better performance results nettcpbinding
.
Comments
Post a Comment