how to send Map object by using client library
Hi
I'm trying to extend "HelloJazz"
https://jazz.net/learn/LearnItem.jsp?href=content/docs/hello-jazz/index.html
to be able to send Map<String, Object&gt; object as well as String.
(">" is expressed to "&gt;" in following sentences)
To achieve this, I added interface and impl to each package as follows.
com.ibm.team.repository.common.transport.ServiceMethodInvocationError: java.lang.ClassCastException: java.util.HashMap incompatible with org.eclipse.emf.ecore.EObject
at com.ibm.team.repository.transport.client.RemoteTeamService.getAppropriateException(RemoteTeamService.java:571)
at com.ibm.team.repository.transport.client.RemoteTeamService.executeMethod(RemoteTeamService.java:474)
at com.ibm.team.repository.transport.client.RemoteTeamService.invoke(RemoteTeamService.java:184)
at com.ibm.team.repository.transport.client.ServiceInvocationHandler.invoke(ServiceInvocationHandler.java:43)
...
This means complicated object(such as Map) cannot be sended in raw condition from client library to server side,
and some marshal steps are needed ?
If so, do we have to write marshaling methods by myself or some methods are prepared for this purpose ?
These 2 are my questions.
Thanks
Ken
I'm trying to extend "HelloJazz"
https://jazz.net/learn/LearnItem.jsp?href=content/docs/hello-jazz/index.html
to be able to send Map<String, Object&gt; object as well as String.
(">" is expressed to "&gt;" in following sentences)
To achieve this, I added interface and impl to each package as follows.
- common packagehowever I met this error by running these code...
Map<String, Object&gt; sendMap(Map<String, Object&gt; map) throws TeamRepositoryException;
- client package
Map<String, Object&gt; sendMap(Map<String, Object&gt; map) throws TeamRepositoryException;
- client internal package
public Map<String, Object&gt; sendMap(Map<String, Object&gt; map) throws TeamRepositoryException{
Map<String, Object&gt; newMap = getService().sendMap(map);
return newMap;
}
- service package
public Map<String, Object&gt; sendMap(Map<String, Object&gt; map) throws TeamRepositoryException{
Iterator<String&gt; iter = map.keySet().iterator();
while(iter.hasNext()){
String key = iter.next();
String value = (String)map.get(key);
System.out.println("key:" + key+ ",value:" + value);
}
return map;
}
com.ibm.team.repository.common.transport.ServiceMethodInvocationError: java.lang.ClassCastException: java.util.HashMap incompatible with org.eclipse.emf.ecore.EObject
at com.ibm.team.repository.transport.client.RemoteTeamService.getAppropriateException(RemoteTeamService.java:571)
at com.ibm.team.repository.transport.client.RemoteTeamService.executeMethod(RemoteTeamService.java:474)
at com.ibm.team.repository.transport.client.RemoteTeamService.invoke(RemoteTeamService.java:184)
at com.ibm.team.repository.transport.client.ServiceInvocationHandler.invoke(ServiceInvocationHandler.java:43)
...
This means complicated object(such as Map) cannot be sended in raw condition from client library to server side,
and some marshal steps are needed ?
If so, do we have to write marshaling methods by myself or some methods are prepared for this purpose ?
These 2 are my questions.
Thanks
Ken