Being a bit rusty with WS implementations I choose to just use an "all-you-every-need" WS solution.
Needless to say that it generates the stubs and everything I needed for my console test client in no time.
The problems started after I had deployed the client in the OSGI container.
I got a runtime exception
java.lang.NoClassDefFoundError: com.sun.xml.internal.ws.api.message.Header
Being in OSGI land I immediately thought that I have to add a missing dependency. I searched the cxf site and went with the single-cxf bundle.
That bundle however is assembled to provide webservices within OSGI and is therefore quite fat and hard to configure. After seeing a spring instance starting in that bundle, I decided to search for a leaner solution which eventually turned out to be pretty simple:
There is no need for cxf when all that is required is a simple WS client (assuming you can use JDK 6). For stub generation the wsimport shell command from the JDK can be used (or a corresponding maven plugin).
The only thing then needed on the server side is the bootstrapping of the com.sun.xml.internal.ws package which is normally not provided by the system bundle of felix (the osgi container I use):
org.osgi.framework.bootdelegation=com.sun.xml.internal.ws.*
Nice and simple.
Keine Kommentare:
Kommentar veröffentlichen