[OFBiz] Dev - Call java service from simple method problem

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

[OFBiz] Dev - Call java service from simple method problem

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 :

  •      ERROR: Could not complete the Create Customer Requirement Role process [problem invoking the [fillExcel] service with the map named [inMap] containing [{locale=en_US, userLogin=[GenericEntity:UserLogin][createdStamp,2005-01-09 21:57:48.537(java.sql.Timestamp)][createdTxStamp,2005-01-09 21:57:48.537(java.sql.Timestamp)][currentPassword,zena(java.lang.String)][disabledDateTime,null()][enabled,Y(java.lang.String)][hasLoggedOut,N(java.lang.String)][lastCurrencyUom,null()][lastLocale,null()][lastUpdatedStamp,2005-07-17 11:47:12.312(java.sql.Timestamp)][lastUpdatedTxStamp,2005-07-17 11:47:12.312(java.sql.Timestamp)][partyId,10020(java.lang.String)][passwordHint,null()][successiveFailedLogins,0(java.lang.Long)][userLoginId,zeid(java.lang.String)], custRequestId=10920}]: The following required parameter is missing: inMap]

 

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
Reply | Threaded
Open this post in threaded view
|

RE: [OFBiz] Dev - Call java service from simple method problem

Chris Chesney

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
Sent: Sunday, July 17, 2005 10:23 AM
To: OFBiz Project Development Discussion
Subject: [OFBiz] Dev - Call java service from simple method problem

 

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 :

  •      ERROR: Could not complete the Create Customer Requirement Role process [problem invoking the [fillExcel] service with the map named [inMap] containing [{locale=en_US, userLogin=[GenericEntity:UserLogin][createdStamp,2005-01-09 21:57:48.537(java.sql.Timestamp)][createdTxStamp,2005-01-09 21:57:48.537(java.sql.Timestamp)][currentPassword,zena(java.lang.String)][disabledDateTime,null()][enabled,Y(java.lang.String)][hasLoggedOut,N(java.lang.String)][lastCurrencyUom,null()][lastLocale,null()][lastUpdatedStamp,2005-07-17 11:47:12.312(java.sql.Timestamp)][lastUpdatedTxStamp,2005-07-17 11:47:12.312(java.sql.Timestamp)][partyId,10020(java.lang.String)][passwordHint,null()][successiveFailedLogins,0(java.lang.Long)][userLoginId,zeid(java.lang.String)], custRequestId=10920}]: The following required parameter is missing: inMap]

 

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