As per

https://cwiki.apache.org/confluence/display/OFBIZ/Using+XMLRPC+with+Flex+client

In OFBiz the limitations are simple types. GenericValue object will
> convert to Maps and be supported as Structs in XMLRPC, besides that
> you should limit your parameters to simple types (string, double,
> integer, map, list, etc). There is a xmlrpc event in webtools
> (controller.xml) which allows you to call any service which has
> export="true" specified.
>


i think the above para is commenting about the output/response formatting.
the concern is that XMLRPC  supports types as mentioned in

https://ws.apache.org/xmlrpc/types.html

which covers only the basic types , i guess there is nothing in
xmlrpc that can directly convert to genericvalue that OFBiz is
expecting . I guess we need a procedure to convert incoming
map (or nested maps) to OFBiz genericvalue.

regds
mallah.











On Fri, Mar 23, 2018 at 1:10 AM, Rajesh Mallah <[email protected]>
wrote:

>  Hi ,
>
> I had been using XMLRPC regularly for invoking OFBiz functions and getting
> results.
> However with below function calculateProductPrice I am facing problem in
> passing the
> "product" param . I am getting the error below:
>
> Service: calculateProductPrice faultString:Type check failed for field
> [calculateProductPrice.product]; expected type is
> [org.apache.ofbiz.entity.GenericValue]; actual type is [java.util.HashMap]
>
> my question is how/what do i send using XMLRPC so that the casting of
> "GenericValue" works.
>
>
> regds
> mallah.
>
>
> ================> Defination of function calculateProductPrice
> <=============================================
> public static Map<String, Object> calculateProductPrice(DispatchContext
> dctx, Map<String, ? extends Object> context) {
>         Delegator delegator = dctx.getDelegator();
>         LocalDispatcher dispatcher = dctx.getDispatcher();
>         Map<String, Object> result = new HashMap<String, Object>();
>         Timestamp nowTimestamp = UtilDateTime.nowTimestamp();
>
>         GenericValue product = (GenericValue) context.get("product");
>         String productId = product.getString("productId");
>         String prodCatalogId = (String) context.get("prodCatalogId");
>         String webSiteId = (String) context.get("webSiteId");
>         String checkIncludeVat = (String) context.get("checkIncludeVat");
>         String surveyResponseId = (String) context.get("surveyResponseId"
> );
>         Map<String, Object> customAttributes =
> UtilGenerics.checkMap(context.get("customAttributes"));
>
>         String findAllQuantityPricesStr = (String) context.get("
> findAllQuantityPrices");
>         boolean findAllQuantityPrices = "Y".equals(
> findAllQuantityPricesStr);
>         boolean optimizeForLargeRuleSet = "Y".equals(context.get("
> optimizeForLargeRuleSet"));
>
>         String agreementId = (String) context.get("agreementId");
>
>         String productStoreId = (String) context.get("productStoreId");
>         String productStoreGroupId = (String) context.get("
> productStoreGroupId");
>         Locale locale = (Locale) context.get("locale");
>
>         GenericValue productStore = null;
>
>

Reply via email to