Web Application and Windows Application working together

  • Thread starter Thread starter Terry Holland
  • Start date Start date
T

Terry Holland

We are developing an ASP application for our organisation's intranet. Part
of the application is a scanning facility to allow users to scan documents
onto Customer records. As I see it we have a couple of options.

1) encapsulate the scanning functionality within a windows user control and
place this control onto a webform using the <object
classid="MyUserControl.dll#MyUserControl.MyUserControl1"> tag
2) program the scanning functionality into a winforms app

For option 1 to work, I would have to set up a trust zone that allowed code
from my scanning page to access hardware on the local pc. This is not an
attractive option as we are intending to sell this product to other
organisations and it may be the case that they would not allow such a trust
relationship to be created.

For option 2 to work, I would need to come up with a way of allowing the
users to seamlessly switch from asp application to windows scanning
application. The idea that Ive got in mind is as follows
Creating page in ASP application with Scan button. When the button is
clicked, a file containing Customer (CUSTOMER.xml) data would be saved to
client PC
Creating a winforms scanning application (SCAN_WIN) that is installed on
client PC
Creating a windows service (SCAN_SERVICE) installed on client pc) that
waits for such a client file to be saved on the client PC. When file is
detected, the SCAN_WIN application would be opened and it would load
Customer data from the CUSTOMER.xml file.

Ive got a few specifics that I would welcome somw opinions on but would
gladly take advice on any other related matters

a) Im just starting to explore this scenario and it seems to make sense that
the SCAN_SERVICE application uses a FileSystemWatcher object to monitor a
directory on local machine. It also makes sense for the ASP application to
save the CUSTOMER.xml into IsolatedStorage. What Im not sure about is how
to have the FileSystemWatcher monitor IsolatedStorage.

b) Im not sure if 3 different applications can access the same
IsolatedStorage area. Is this possible

c) If we were to go down the route of windows control on webform, would the
MyUserControl.dll be downloaded to client pc each time page was accessed (it
would be quite large)?

d) If we were to go down the route of windows control on webform, would
there be an 'acceptable' method of doing this in relation to security and
trust zones


tia

Terry
 
Terry,

Forget it to search for the possibilitiy to download to a client computer as
you don't have the possibility to let the user (and only the user) give you
the rigth to install an activeX (and then it is mostly more simple to create
a simple windowforms application at the user side which works over Internet.

To do it with webbrowser and windowsform is almost completely made
impossible and not the next security update will do that.

However, Did you already had a lookk at siverlight in my idea can that be
one of the solutions for your problem?

Cor
 
Terry said:
We are developing an ASP application for our organisation's intranet. Part
of the application is a scanning facility to allow users to scan documents
onto Customer records. As I see it we have a couple of options.

ASP.NET wouldn't be in the picture. It would be an all Windows Desktop
using a Windows Presentation Foundation solution. I would also look into
using Windows Work Flow as a possibility implemented into the solution,
as it seems to be a candidate for controlling the process and user flow
of work to get documents established into the system.
 
Unfortunately ASP.Net has to be in the picture. A lot of time and effort has
been invested in developing the ASP application and now we need the ability
to scan documents. We are exploring the idea of having a asp page that
saves a record in a database table. The windows service on client machine
would detect a change in this table and start up the WinForm scan
application. When the scan application is done, the database table would be
updated and this update would be detected asynchronously by the asp page
that initiated the process. This is achievable in the timescale we have
with the skills we have. WPF & WWF would be too steep a learning curve
given the time constraints that we have, though I will certainly be
investigating what they have to offer
 
Unfortunately ASP.Net has to be in the picture. A lot of time and effort has
been invested in developing the ASP application and now we need the ability
to scan documents.  We are exploring the idea of having a asp page that
saves a record in a database table.  The windows service on client machine
would detect a change in this table and start up the WinForm scan
application.  When the scan application is done, the database table would be
updated and this update would be detected asynchronously by the asp page
that initiated the process.   This is achievable in the timescale we have
with the skills we have.  WPF & WWF would be too steep a learning curve
given the time constraints that we have, though I will certainly be
investigating what they have to offer


Perhaps a more effective and realtime dialogue between client and
server (were scanner is attached)
could be realized by via sockets. It would be even easier to
implement...
Which is not even incompatible with having an asp.net local interface,
if needed because "fashionable" :) ...

Tommaso
 
Terry said:
We are developing an ASP application for our organisation's intranet. Part
of the application is a scanning facility to allow users to scan documents
onto Customer records. As I see it we have a couple of options.

1) encapsulate the scanning functionality within a windows user control and
place this control onto a webform using the <object
classid="MyUserControl.dll#MyUserControl.MyUserControl1"> tag
2) program the scanning functionality into a winforms app
For option 2 to work, I would need to come up with a way of allowing the
users to seamlessly switch from asp application to windows scanning
application. The idea that Ive got in mind is as follows
Creating page in ASP application with Scan button. When the button is
clicked, a file containing Customer (CUSTOMER.xml) data would be saved to
client PC
Creating a winforms scanning application (SCAN_WIN) that is installed on
client PC
Creating a windows service (SCAN_SERVICE) installed on client pc) that
waits for such a client file to be saved on the client PC. When file is
detected, the SCAN_WIN application would be opened and it would load
Customer data from the CUSTOMER.xml file.

Ive got a few specifics that I would welcome somw opinions on but would
gladly take advice on any other related matters

a) Im just starting to explore this scenario and it seems to make sense that
the SCAN_SERVICE application uses a FileSystemWatcher object to monitor a
directory on local machine. It also makes sense for the ASP application to
save the CUSTOMER.xml into IsolatedStorage. What Im not sure about is how
to have the FileSystemWatcher monitor IsolatedStorage.
<snip>

Maybe I'm not seeing the big picture here, but I wonder why do you
want to monitor the client file system when it would be more practical
(in this scenario) to monitor the actual server?

So, instead of going this route, I would build the logic to update the
user profile in the scanner application itself. Couple that with the
ability from the web page (via Ajax) to query for an update *in the
server* and your cicle is reduced to this:

a) Web app deploys the application;
b) user runs the application and eventually scans his/her docs. User
provides credencials (login, password?) so the application can deploy
the scanned data to the web server (via a web service, perhaps);
c) if the web app is still open and in the correct state, it detects
the user profile update in the server and updates itself to reflect
that (this is optional, of course, but would be really cool).

If I'm not mistaken, that was what Google did to allow the interaction
between www.blogger.com and the Picassa application.

HTH.

Regards,

Branco.
 
Back
Top