GenericValue object - OFBiz Web services

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

GenericValue object - OFBiz Web services

rohit369
Hi All,

I have a basic question about the org.ofbiz.entity.GenericValue complex java object.
I am implementing a RESTFul API layer as a component in the OFBiz. Here, I am exposing REST API to the external world and in turn I am trying to access the standard OFBiz web service in the layer code using Delegator and LocalDispatcher available in the web servlet context.
My question here is when I want to call OFBiz service like "aimCCAuth" in org.ofbiz.accounting.thirdparty.authorizedotnet.AIMPaymentServices, if we observe the IN Parameter list, there are 2 parameters (credit card and orderPaymentPreference) mandatory with org.ofbiz.entity.GenericValue type. I dont know how to create this object since I am on the client side but within the OFBiz package as a component under /hot-deploy folder.
Any light and help on this topic is greatly appreciated. I am stuck at this point.

Thanks & Regards,

Rohit
Reply | Threaded
Open this post in threaded view
|

Re: GenericValue object - OFBiz Web services

rohit369
I think I got it right now. Lets say for the above service the following are the IN Parameters:

billToEmail org.ofbiz.entity.GenericValue IN
billToParty org.ofbiz.entity.GenericValue IN
billingAddress org.ofbiz.entity.GenericValue IN
creditCard org.ofbiz.entity.GenericValue IN
currency String IN
customerIpAddress String IN
locale True       java.util.Locale INOUT
login.password String IN
login.username String IN
orderId String IN
orderItems List IN
orderPaymentPreference org.ofbiz.entity.GenericValue IN

In the above list, the parameters with org.ofbiz.entity.GenericValue type directly correlates to a database Entity. We have to create an corresponding object of type org.ofbiz.entity.GenericValue i.e. GenericValue billToParty = new GenericValue(delegator.getModelEntity("Party"));
Populate the above object with all the required fields in the Entity definition and send the same in the service context to the server.
Please correct me if I am wrong.
Reply | Threaded
Open this post in threaded view
|

Re: GenericValue object - OFBiz Web services

Jacopo Cappellato-4

On Jun 19, 2012, at 4:50 PM, rohit369 wrote:

> GenericValue billToParty =
> new GenericValue(delegator.getModelEntity("Party"));

GenericValue billToParty = delegator.makeValue("Party");

Kind regards,

Jacopo