由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - web service returns HashMap that contains multiple ArrayList
相关主题
Java里有没有象cell array一样的东西Can someone help on Soap?
Java 面试常见问题!webservices products
Simple question: delete element from collection on condition?Web Services 现在很热吗?
几个Java面试题怎么把servlet publish成web services
请问这个面试题,关于synchronize hashmap简单的问题,搞不懂了, 帮忙
[转载] Lousy WSDL?什么是JAX WS
Help: web service questionssoa变成rest,大家公司在用哪个?
Re: Which Web service is better EJB or Rsoap binding with CXF
相关话题的讨论汇总
话题: hashmap话题: arraylist话题: contains话题: service话题: web
进入Java版参与讨论
1 (共1页)
m******o
发帖数: 774
1
Working on converting a rmi call to web service. The converting itself is no
big deal until I found out the returned value is a HashMap that has 7
ArrayLists. Each of these ArrayList has multiple 'regular' objects (A class
that describes a working shift), and each of these objects contains two more
ArrayLists, one contains classes that describe each segment of this shift
and the other describes related breaks and lunches, etc.
I plan to go the dumb way to convert this stupid thing to a big Strin
t*******e
发帖数: 684
2
The Java2WSDL approach doesn't work for you?
m******o
发帖数: 774
3
I created the web service using annotation @WebService, etc. It appears that
a wsdl file is created automatically when the code is deployed within JBoss
. The wsdl file specifies that the return type of this web service method
would be 'hashMap'. However when the method is being called, an error is
thrown saying 'hashMap' is not a recognized type. I googled around and it
does look like HashMap,ArrayList etc. are no longer supported by current web
service specification. I assume java2wsdl would f

【在 t*******e 的大作中提到】
: The Java2WSDL approach doesn't work for you?
g*****g
发帖数: 34805
4
Convert it to big string is too much of a hassle, if
Map is not supported, 2 arrays, one for key, one for values
will do the job fine.

that
JBoss
web
if

【在 m******o 的大作中提到】
: I created the web service using annotation @WebService, etc. It appears that
: a wsdl file is created automatically when the code is deployed within JBoss
: . The wsdl file specifies that the return type of this web service method
: would be 'hashMap'. However when the method is being called, an error is
: thrown saying 'hashMap' is not a recognized type. I googled around and it
: does look like HashMap,ArrayList etc. are no longer supported by current web
: service specification. I assume java2wsdl would f

m******o
发帖数: 774
5
Are you saying to have a wrapper class that contains two arrays? Would it
work if each element of the value array also contains the unsupported
ArrayList?

【在 g*****g 的大作中提到】
: Convert it to big string is too much of a hassle, if
: Map is not supported, 2 arrays, one for key, one for values
: will do the job fine.
:
: that
: JBoss
: web
: if

g*****g
发帖数: 34805
6
I would think so. You probably can find out faster than
I type.

【在 m******o 的大作中提到】
: Are you saying to have a wrapper class that contains two arrays? Would it
: work if each element of the value array also contains the unsupported
: ArrayList?

m******o
发帖数: 774
7
I tried to return just one array (EmployeeDetail[]) the other day but this
line
Service service = factory.createService(url, qname);
throws an exception saying I got duplicate member fields. Apparently it did
not differentiate EmployeeDetail and EmployeeDetail[]. (Or I failed to
supply it with the information) Right now I am trying to avoid adding extra
wsdl at the client (caller) side but that's probably necessary if any of the
non-standard types are involved.
Since I got a due date by the end

【在 g*****g 的大作中提到】
: I would think so. You probably can find out faster than
: I type.

Q**g
发帖数: 183
8
how about json?

no
class
more

【在 m******o 的大作中提到】
: Working on converting a rmi call to web service. The converting itself is no
: big deal until I found out the returned value is a HashMap that has 7
: ArrayLists. Each of these ArrayList has multiple 'regular' objects (A class
: that describes a working shift), and each of these objects contains two more
: ArrayLists, one contains classes that describe each segment of this shift
: and the other describes related breaks and lunches, etc.
: I plan to go the dumb way to convert this stupid thing to a big Strin

t*******e
发帖数: 684
9
I had one JAX-WS enabled Spring bean. One interface method returns Map, and
it works just fine. The JAX-WS runtime is Metro though.
m******t
发帖数: 2416
10

I was going to suggest this too. There's nothing wrong with serializing
the whole thing into a big string, just don't do it yourself. :)

【在 Q**g 的大作中提到】
: how about json?
:
: no
: class
: more

m******o
发帖数: 774
11
Unfortunately I'm not sure I can get it done in time using any of the smart
ways so I played safe and did the serialization myself and just finished it
today. Got a few other things to take care of, will go back and try the
better ways after that.
Thanks for all inputs.

【在 m******t 的大作中提到】
:
: I was going to suggest this too. There's nothing wrong with serializing
: the whole thing into a big string, just don't do it yourself. :)

1 (共1页)
进入Java版参与讨论
相关主题
soap binding with CXF请问这个面试题,关于synchronize hashmap
如何学习用Java开发Web Service?[转载] Lousy WSDL?
JMS这东西用的多吗?Help: web service questions
List, LinkedList and VectorRe: Which Web service is better EJB or R
Java里有没有象cell array一样的东西Can someone help on Soap?
Java 面试常见问题!webservices products
Simple question: delete element from collection on condition?Web Services 现在很热吗?
几个Java面试题怎么把servlet publish成web services
相关话题的讨论汇总
话题: hashmap话题: arraylist话题: contains话题: service话题: web