two ofbiz application communicating through SOAP

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

two ofbiz application communicating through SOAP

jin1212
Hello,
   Our company has the need to physically have accounting/manufacturing portion of Ofbiz on server A, and e-commerce apps on server B,C,D .. etc. The servers will have to communicate through web services call provided all relevent services have 'export' flag set to true. I would like to know if this is even possible because Ofbiz uses a a single database for all its applications. I can see issues right now with database syncing. For example, different products with same id. Unless there is a way to identify the global productId  from a clientProductId, I just dont see how this can be done.

thank you, jeremy
 
Reply | Threaded
Open this post in threaded view
|

RE: two ofbiz application communicating through SOAP

Akotaobi, Uche
[jin1212]

> Hello,
>    Our company has the need to physically have
> accounting/manufacturing portion of Ofbiz on server A, and
> e-commerce apps on server B,C,D .. etc.
> The servers will have to communicate through web services
> call provided all relevent services have 'export' flag set to
> true. I would like to know if this is even possible


Sure--Apache Axis makes web service calls pretty simple.


> because Ofbiz uses a a single database for all its applications.


That's easily changed in framework/entity/config/entityengine.xml.  Either add a new <group-map/> with a different name and then refer to that group for all of your custom entities or edit the existing org.ofbiz group-map.  Change the "localderby" to something else like "localpostgres", add the JDBC driver to framework/entity/lib/jdbc, and edit the JDBC connection settings.

http://ofbiz.apache.org/docs/entity.html


> I can see issues right now with database syncing. For example, different
> products with same id. Unless there is a way to identify the global
> productId from a clientProductId, I just dont see how this can be done.


How about making a "MachineInfo" entity with a "machineId" field and "run-install-seed"ing it with a different GUID for each server?  Then you could have your services return that ID, combine it with an existing field to make a new primary key, or whatever.  The possibilities are limitless.


--
Uche O. Akotaobi
Workflow Engineer
Xerox Corporation
701 South Aviation Blvd., ESAE-116
El Segundo, CA  90245
Phone (310) 333-2403  Internal 8*823-2403
Fax (310) 333-8419
[hidden email]

XEROX
Technology.  Document Management.  Consulting Services

www.xerox.com
Reply | Threaded
Open this post in threaded view
|

Re: two ofbiz application communicating through SOAP

Pradeep Chaudhary
You can set unique "sequenced-id-prefix" value for the delegator in
entityengine.xml for each ofbiz instance. This will ensure that the
all the sequence generated from a ofbiz instance have prefix attached
to primary key. This makes is easy to identify between two different
instances.

Pradeep

On 7/31/07, Akotaobi, Uche <[hidden email]> wrote:

> [jin1212]
>
> > Hello,
> >    Our company has the need to physically have
> > accounting/manufacturing portion of Ofbiz on server A, and
> > e-commerce apps on server B,C,D .. etc.
> > The servers will have to communicate through web services
> > call provided all relevent services have 'export' flag set to
> > true. I would like to know if this is even possible
>
>
> Sure--Apache Axis makes web service calls pretty simple.
>
>
> > because Ofbiz uses a a single database for all its applications.
>
>
> That's easily changed in framework/entity/config/entityengine.xml.  Either add a new <group-map/> with a different name and then refer to that group for all of your custom entities or edit the existing org.ofbiz group-map.  Change the "localderby" to something else like "localpostgres", add the JDBC driver to framework/entity/lib/jdbc, and edit the JDBC connection settings.
>
> http://ofbiz.apache.org/docs/entity.html
>
>
> > I can see issues right now with database syncing. For example, different
> > products with same id. Unless there is a way to identify the global
> > productId from a clientProductId, I just dont see how this can be done.
>
>
> How about making a "MachineInfo" entity with a "machineId" field and "run-install-seed"ing it with a different GUID for each server?  Then you could have your services return that ID, combine it with an existing field to make a new primary key, or whatever.  The possibilities are limitless.
>
>
> --
> Uche O. Akotaobi
> Workflow Engineer
> Xerox Corporation
> 701 South Aviation Blvd., ESAE-116
> El Segundo, CA  90245
> Phone (310) 333-2403  Internal 8*823-2403
> Fax (310) 333-8419
> [hidden email]
>
> XEROX
> Technology.  Document Management.  Consulting Services
>
> www.xerox.com
>
Reply | Threaded
Open this post in threaded view
|

RE: two ofbiz application communicating through SOAP

Akotaobi, Uche
[snip]

[jin1212]
> I can see issues right now with database syncing. For example,
> different products with same id. Unless there is a way to identify
> the global productId from a clientProductId, I just dont see how
> this can be done.

[Uche Akotaobi]
> How about making a "MachineInfo" entity with a "machineId"
> field and "run-install-seed"ing it with a different GUID for
> each server?  Then you could have your services return that
> ID, combine it with an existing field to make a new primary
> key, or whatever.  The possibilities are limitless.

[Pradeep Chaudhary]
> You can set unique "sequenced-id-prefix" value for the delegator in
> entityengine.xml for each ofbiz instance. This will ensure that the all the
> sequence generated from a ofbiz instance have prefix attached to primary
> key. This makes is easy to identify between two different instances.


Very interesting!  I can see uses for this--thanks for the tip.

--
Uche O. Akotaobi
Workflow Engineer
Xerox Corporation
701 South Aviation Blvd., ESAE-116
El Segundo, CA  90245
Phone (310) 333-2403  Internal 8*823-2403
Fax (310) 333-8419
[hidden email]

XEROX
Technology.  Document Management.  Consulting Services

www.xerox.com
Reply | Threaded
Open this post in threaded view
|

Re: two ofbiz application communicating through SOAP

jin1212
In reply to this post by jin1212
Thank you both for the tips!
I have begin to dig in to the actual implementation, and I have encountered a problem.
Looking at controller.xml for the e-commerce portion, there is a request uri called 'processOrder' which triggers an event to a java method called 'createOrder'. This method takes in the usual HttpServletRequest, and HttpServletResponse. However my problem is that I need to be able to call this method through web services.
As I recall, only services can be directly exported for web services call.
My question is can I really create a service element inside the services.xml using engine="java" and invoke 'createOrder'?
Looking at all service definition with java classes, all the method takes in DispatchContext dctx,Map context. Does this mean I need to create a wrapper or some sort? how would I go about doing this because there a lot of uri mappings inside controller.xml that has java method (HttpServletRequest,HttpServletResponse) for the event trigger instead of a service call trigger.

thank you, jeremy