Holly zheng wrote:I have a bpel project deployed on activebpel server. I use the eclipse web service explorer to test the web service, got right answer. but when I use wsdl2java to generate a client to test the web service, the return value is wrong.
request: int
response: timeInfo (class timeInfo{ private float exeTime; private int invkTimes; ...})
In the client java code, I use response = port.request(3); response.getExeTime() and response.getInvkTimes() to get the return value from the web service and I always get 0.0 and 0.
could this be something wrong related to the encoding method: literal? and _resp = _call.invoke(..) can't recognize the response msg automatically? i don't know. can anyone help?
Ivan Krizsan wrote:Hi!
It sounds like the problem may be related to the data binding.
If you do not manage to solve this in any other way, then you could try to write a web service client that receives and interprets response message itself.
Example:
If you want to use JAXB to do the data binding you use XJC to generate JAXB bean classes from the XML schema describing the message payloads.
In your client, when it receives a response, you use JAXB to unmarshall the payload and thus obtain instance(s) of the JAXB bean classes generated earlier, from which data of the response can be retrieved.
Of course JAXB is just one alternative - if you are happier using StAX, SAX etc. etc. then just go ahead!
Best wishes!
Ivan Krizsan wrote:Hi!
Just curious, what web service stack do you use and what kind of data binding mechanism?
I usually use JAXB for XML data binding and have never encountered any problems like the ones you are describing.
Best wishes!