Dear all I want to call a java service from
simple method with input map argument -I put the following code in the services.xml file where we put the service definintion <service name="fillExcel"
engine="java"
location="org.ofbiz.workeffort.requirement.RequirementServices"
invoke="fillExcel"> <description>fill The Excel File</description>
<attribute name="inMap"
type="java.util.Map" mode="IN"
optional="false"/> </service> -The following code is in the simple
Method file I put the parameters I want to pass to
the service
inside a Map <field-to-field
field-name="custRequestId" map-name="custRequest" to-map-name="inMap"/> <call-service
service-name="fillExcel"
in-map-name="inMap"/> -The following code in RequirementServices.java : public void fillExcel(DispatchContext
ctx, Map context) { try {
GenericDelegator delegator
= ctx.getDelegator();
Map inMap= (Map)context.get("inMap");
String custRequestId = (String)inMap.get("custRequestId");
………………….
then I got
this error :
Please
can any one tell me where is the problem Thanks
in advance -Mamdouh _______________________________________________ Dev mailing list [hidden email] http://lists.ofbiz.org/mailman/listinfo/dev |
Mamdouh, The inMap in your simple method is just
the container (map) for your service parameters. You need to either put a map
called inMap into your existing “inMap” or better yet, change your
service definition (services.xml) to expect the actual parameter
(custRequestId) instead of a map. -Chris From:
[hidden email] [mailto:[hidden email]] On Behalf Of Mamdouh Kaadan Dear all I want to call a java service from
simple method with input map argument -I put the following code in the
services.xml file where we put the service definintion <service name="fillExcel" engine="java"
location="org.ofbiz.workeffort.requirement.RequirementServices"
invoke="fillExcel">
<description>fill The Excel File</description> <attribute
name="inMap" type="java.util.Map" mode="IN"
optional="false"/> </service> -The following code is in the simple
Method file I put the parameters I want to pass to
the service inside a Map <field-to-field
field-name="custRequestId" map-name="custRequest"
to-map-name="inMap"/> <call-service
service-name="fillExcel"
in-map-name="inMap"/> -The following code in
RequirementServices.java : public
void fillExcel(DispatchContext
ctx, Map context) { try { GenericDelegator
delegator = ctx.getDelegator(); Map inMap= (Map)context.get("inMap");
String custRequestId =
(String)inMap.get("custRequestId");
…………………. then I got this error :
Please
can any one tell me where is the problem Thanks
in advance -Mamdouh _______________________________________________ Dev mailing list [hidden email] http://lists.ofbiz.org/mailman/listinfo/dev |
Free forum by Nabble | Edit this page |