.net - Two-way communication between web application and desktop application -
i curious if scenario possible:
- .net windows forms application (our product) couple of wcf services exposed (self hosted, example on 'http://localhost:8000/myservice/method1'), running in elevated mode.
- a web application (from manufacturer) on public domain, communicate our application in two-way mode:
- web application desktop application: during setup of our application register custom protocol 'xxx' (similar 'mailto') , set our application handler protocol. web application can trigger action in our desktop application links in form 'href="xxx:parameters"'.
- desktop application web application: web application periodically (every second example) poll our localhost wcf services via javascript ajax calls.
is 2.2 option possible? binding should use wcf services? there problems cross domain calls (from public domain localhost)?
edit - yes, communication not two-way because in our scenario desktop application cannot directly manipulate web application. polling option idea how state desktop application web application, if there better alternatives hear :)
there couple of other alternatives communication between web application , desktop application (java plugins, active x ie, firefox plugins, chrome native plugin,...) fragile regarding new versions of browsers, versions of java, version of windows,... , have maintain of them. looking option work on major browsers , manufacturer, responsible web application, have little work possible.
is 2.2 option possible?
which binding should use wcf services?
for incoming calls web app (href links) should expose service operation rest endpoint, using wcf webhttpbinding or nancy, lighter.
for polling, mentioned, need host rest endpoint.
two-way communication between web application , desktop application
based on description, doesn't appear genuine two-way requirement, in duplex (calls going both ways). in both scenarios outline calls originate on partner website. it's responses travel other way, or missing something?
the polling option idea how state desktop application web application
strictly speaking, polling originator not web app per se, client browser via javascript. apart architectural concerns of using client app intermediary between desktop , server, there real complication around implementing cross-origin scripting in browser.
i suggest better solution call web app desktop app when state changes, , have web app "notify" web client, either via ajax polling (to web app), or something signalr.
this not more work partner although need host new "status changed" endpoint call, ajax polling task simpler seeing they'd polling own service rather yours.
Comments
Post a Comment