Accessing a SOAP WebService
I have not found any convinient way to create something like a jaxws wrapperclass for an existing Soap Webservice - like in full Java. Jaxws is unfortunately not avaliable in the sd开发者_开发问答k.
Is there any was to do this without using any external libs? Are there any external libs at all yet?
The short answer is that no, there isn't any way to do exactly what you want. However, there is a DOM and SAX implementation. If you know what the incoming XML looks like (which you should anyways) then you could write a custom unmarshaller.
I really don't want to manually write/decode any soap messages. I just want to consume an external webservice. Its really easy to do that with full blown java libs and tools (wsimport) and create the corresponding wrapper-classes to access the ws as "normal" java classes. The usual ws client programmer will never need to touch any backend soap stuff at all... Thats what the jaxws client classes are for. ksoap is unfortunately only a first step to access soap stuff at all - no wsdl-based codegeneration so far as I know... Hopefully the sdk will adress this issua in one of the next versions as many ws are out there and handcoding this stuff is really messy...
精彩评论