Ok,
This is what I would like to do considering all of the options mentioned in
the previous posts:
1) Taking the bean-first approach, create domain-specific POJOs that will
have hibernate and jaxb2 annotations
2) Create our own specific XSD that will map cleanly with our POJOs (is this
necessary?)
Then, for the integration piece I would like to:
1) Poll the files I want to import into my application
2) FTP all the files found over to my server (where ServiceMix is running)
3) unzip any compressed files
4) Use XSLT to transform the external party's XML to our application-defined
XML based on our XSD
5) Invoke JAXB2 to unmarshall the XML into our domain-specific POJOs
6) make a call to our DAO to persist the POJOs via hibernate into our DB.
Now after stating all of these steps, can ServiceMix help facilitate each
step (or atleast make some of the steps above easier)? If ServiceMix can
help me out with the above, how do I go about implementing each step, i.e.
do I need to develop a service component, a binding component, a unit, an
assembly, etc., for each step? Since I'm still a bit clueless to all of
this, any guidance would be greatly appreciated. Thanks!
-los
James.Strachan wrote:
>
> On 10/3/06, moraleslos <[EMAIL PROTECTED]> wrote:
>>
>> I dabbled with JAXB 2 as you suggested. JAXB 2 looks good but the issue
>> is
>> it generates many classes that won't get persisted. This is not the
>> fault
>> of JAXB, its just due to the nature of the XML we get (we don't need a
>> lot
>> of the data). Instead, I was thinking about using a tool like Castor to
>> populate our domain-specific bean from the XML.
>
> Or you could just add JAXB 2 annotations to your domain-specific bean
> then you don't have to do any code generation and only the domain
> objects will get persisted and will appear nicely in an XSD?
>
>
>> If I do it this way, how
>> will servicemix fit into the scheme of things?
>
> As Guillaume said, ServiceMix can work either way - whether using
> bean first or schema first, ServiceMix can work with the XML or the
> POJOs and has things like JSR 181 support for doing the marshalling
> etc.
>
>
>> Also suppose that I do use JAXB 2 w/ hyperjaxb (the schema-first
>> suggestion). I don't understand where JSR 181 fits into all of this.
>> Isn't
>> this used for Web Services? I thought I would be using an FTP/polling
>> mechanism to retrieve the XML... not sure how JSR 181 is used to make the
>> retrieval of the XML file work.
>
> Its just a component that does the marshalling of XML to POJOs via JAXB2.
>
> One thing to consider is if you want to turn your 'data objects' into
> some kind of service API & WSDL.
>
> e.g. if you create a bunch of services to accept, say, PurchaseOrders
> and persist them or to look them up using primary/foreign keys - you
> might want to create WSDL so folks can reuse the services from other
> applications.
>
> It might be a good idea if we had a way to take some JAXB POJOs and
> auto-create a WSDL so we create a kinda 'Data Access Object' WSDL /
> interface.
>
> e.g. for a PurchaseOrder we might create some CRUD service to match it
> like this...
>
> public interface PurchaseOrderService {
>
> PurchaseOrder find(Integer primaryKey);
> Integer insert(PurchaseOrder data);
> void update(PurchaseOrder data);
> void delete(Integer primaryKey);
>
> // some foreign key queries etc
> List<PurchaseOrder> findByFoo(String textQuery);
> }
>
> --
>
> James
> -------
> http://radio.weblogs.com/0112098/
>
>
--
View this message in context:
http://www.nabble.com/Would-servicemix-work-with-ftp-xml-integration-tf2376311.html#a6646498
Sent from the ServiceMix - User mailing list archive at Nabble.com.