tuscany-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Millies, Sebastian" <Sebastian.Mill...@softwareag.com>
Subject Re: Wrong result type in web service operation (solved)
Date Mon, 28 Nov 2011 09:08:35 GMT

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?

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

View raw message