[JIRA] Closed: (OFBIZ-633) Use of Hashtable in SOAPClientEngine doesn't allow nulls.

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

[JIRA] Closed: (OFBIZ-633) Use of Hashtable in SOAPClientEngine doesn't allow nulls.

JIRA jira@ofbiz.org
     [ http://jira.undersunconsulting.com/browse/OFBIZ-633?page=all ]
     
Marco Risaliti closed OFBIZ-633:
--------------------------------

    Resolution: Won't Fix

For the moment I will close it if someone interested on it can create a new issue.

> Use of Hashtable in SOAPClientEngine doesn't allow nulls.
> ---------------------------------------------------------
>
>          Key: OFBIZ-633
>          URL: http://jira.undersunconsulting.com/browse/OFBIZ-633
>      Project: [OFBiz] Open For Business
>         Type: Bug
>   Components: service
>  Environment: Windows 2000, XP, and Fedora 3,4,5
>     Reporter: Porter Woodward
>     Assignee: Jira Administrator
>     Priority: Minor

>
> Original Estimate: 5 minutes
>         Remaining: 5 minutes
>
> Interestingly although the method getResponseParams returns a Map, it internally initializes a member variable, mRet with the type "Map", but implementation of Hashtable.  The use of a Hashtable in the SOAPClientEngine prevents the return of "null" values in key/value pairs.  
> Example:  Some service call retrieves an entity - and it then uses the following code:
> String entityId = (String)context.get("entityId");
> if(entityId!=null) {
>  try {
>   GenericValue myEntity =
>     delegator.findByPrimaryKeyCache("MyEntity", UtilMisc.toMap("entityId",entityId));
>   Map result = ServiceUtil.returnSuccess();
>   result.putAll(myEntity);
>   ...
>   return result;
> Now, say that one of the fields of the underlying entity is blank - null - in the database.  Upon thunking thru to the SOAPClientEngine - that Map defined in the 'result' appears to be remapped into a Hashtable in the method call:
> private Map getResponseParams(Message respMessage) {
> ...
>   while (p.hasNext()) {
>     RPCParam param = (RPCParam) p.next();
>     mRet.put(param.getName(), param.getValue());
>     System.out.println(param.getName() + "=" + param.getValue());
>   }
> Of course, in attempting to 'put' the null valued key onto the Hashtable - a null pointer exception is thrown.  Simply changing mRet to use a HashMap as opposed to Hashtable seems to work fine, and correctly handles null valued keys.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.undersunconsulting.com/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira