You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by "Millies, Sebastian" <Se...@softwareag.com> on 2011/11/28 10:08:35 UTC

Re: Wrong result type in web service operation (solved)

From: scottkurz@gmail.com [mailto:scottkurz@gmail.com] On Behalf Of Scott Kurz
Sent: Monday, November 28, 2011 6:46 AM
To: user@tuscany.apache.org
Subject: Re: Wrong result type in web service operation

Hi Sebastian,

Sorry, didn't get a chance to look at your test before taking a few days vacation.

I think your JAXB tweaks may be the problem.

You didn't seem to include the generated ObjectFactory.class and package-info.class files.    Since that's where the package level info/annotations are stored, I'm guessing that's why your Java isn't getting serialized to XML correctly.  (Basically JAXB maps between a schema targetNamespace and a Java package).

Also, I can't recall when you can use a constructor to instantiate a JAXB object (or even if you ever can), but typically ObjectFactory.createXXX methods are used, instead of constructors.

You mentioned tweaking to add java.io.Serializable support.    Did you know that the wsimport and xjc tools give you a way to add that into the generated code by customizing the WSDL/XSD?
[snip]
Scott


Hello Scott,

thank you very much for your taking so much trouble.

My mistake has been not to include the package-info file. Once I did that, it worked.
So now I can use the bare parameter styles with SAP web services – thanks again.

Two notes:

·         The use of new instead of ObjectFactory is unproblematic in this case, but I’d better use the factory in the future.

·         I couldn’t get the WSDL annotation to work for serialization. However, it works when I use a separate bindings.xml (see attached file) with the –b command-line option for wsimport. (Only drawback is that every class has the same serialVersionUID)


n  Sebastian

IDS Scheer Consulting GmbH
Geschäftsführer/Managing Directors: Kamyar Niroumand, Ivo Totev
Sitz/Registered office: Altenkesseler Straße 17, 66115 Saarbrücken, Germany - Registergericht/Commercial register: Saarbrücken HRB 19681
http://www.softwareag.com


Re: Wrong result type in web service operation (solved)

Posted by Scott Kurz <sk...@gmail.com>.
Sebastian,

Yes in browsing the JAXB spec that "serializable" annotation does seem to
only be settable at the global level, so no ideas there.

Glad to help...

Scott