• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Creating a file-sensitive service

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure this is the right forum for this topic, but since I'm not sure where it really belongs to I'll stick with this one.

I am building an application where a Web Service accepts an XML file and stores it in a specific folder. Another service occasionally checks the folder and if it find files in there, it processes them.

Now the XML accepting Web Service is easy, and it does the job. But I'm not really sure what exact technologies should I use for the service which checks the directory... it sounds easy, SHOULD be easy, but I'm hitting a wall here.

Can someone please point me in the right direction? I'm trying to keep things as simple and effective as possible.

Thanks. Cheers!
 
Ranch Hand
Posts: 2108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The first web service indeed can be implemented with web service.

But the second is most likely another technology, not web service. At least, the system that would be waiting for the file, would not be a web service. It can be another system, which would trigger or initiate a call to a web service to process it.

What is your operating system? or environment? jee? ejb? Have you looked at java's jse and jee 'timer' technology? (e.g. you can create either a jse timer or jee timer, that will check the file, regularly, and will call a web service if a condition is met, e.g. if a file exists)

[ August 27, 2007: Message edited by: Jesus Angeles ]
[ August 27, 2007: Message edited by: Jesus Angeles ]
 
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is rather simple, you can write Java code which reads all file in specific directory periodically and holds their names,afterward when new file have been added it can compare new files list to older list and find which one is new.

Oracle BPEL engine has this feature.

You can do all of them with Java then make facade class to use this business and as last step make this facade class Web Service
 
Baba Bizlowsky
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am aware of Oracle BPEL, but it seems to me like an overkill for such a simple task.

I guess the problem is I'd like this whole thing packaged in a neat Web application. Now, I know how to write a Java class which checks periodically a directory, but how do you do it so it becomes a service on the server?
 
Reza Rav.
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Imagine you implement this process in 10 different package and each package have 100 classes.

Can you make one Java class Web Service ? Of course you can it is very simple.
so make one class and this class can calls that complex methods in different packages, then make Web service from this class.

If you don't understand what I explained read about Facade Pattern, that Service class is Facade class
 
reply
    Bookmark Topic Watch Topic
  • New Topic