On Monday 06 December 2004 05:58, Aleksander Slominski wrote:
> Michael Schuerig wrote:
> >After looking into the code, my understanding is that the Java
> > provider currently doesn't support wrapped-style. Has anyone found
> > a workaround for this?
>
> i am not 100% sure about it (i do not have test WSDLs handy) but i
> think Java binding is relatively simple ...
It may be simple relative to the other providers. Still it exemplifies a
programming style that makes me scratch my head. I thought 400+ line
methods with messy side-effects had died off years ago.
Well, WSIF is free, it works for a wide range of cases. If my case is
not covered, the code is available for me to change it. In theory. In
practice, I found that it would be inordinately hard to get the pieces
I would have to touch under test.
> >I have a rough idea what needs to be changed in WSIFOperation_Java,
> > but I must admit that poking around in 400+ line methods is not my
> > idea of fun.
>
> what is it exactly that you want to do with wrapped-style? Java
> invocations in WSIF2 are on Java objects so I am not sure what
> "wrapped-style" means in this case?
A rudimentary WSDL looks like this
<wsdl:definitions ...>
<types ...>
<schema ...>
...
<element name="getMyStuff">
<complexType>
<element name"whichone" type="xsd:string"/>
</complexType>
</element>
<element name="getMyStuffResponse">
<complexType>
<sequence>
<element name="stuff" type="impl:StuffDescriptor"
minOccurs="0" maxOccurs="unbounded" />
</sequence>
</complexType>
</element>
</schema>
</types>
<wsdl:message name="getMyStuffRequest">
<wsdl:part name="parameters" element="impl:getMyStuff"/>
</wsdl:message>
<wsdl:message name="getMyStuffResponse">
<wsdl:part name="parameters" element="impl:getMyStuffResponse"/>
</wsdl:message>
<wsdl:portType name="MyStuffPortType">
<wsdl:operation name="getVerfuegbareMyStuffse">
<wsdl:input name="getVerfuegbareMyStuffseRequest"
message="impl:getVerfuegbareMyStuffseRequest"/>
<wsdl:output name="getVerfuegbareMyStuffseResponse"
message="impl:getVerfuegbareMyStuffseResponse"/>
</wsdl:operation>
</wsdl:portType>
...
</wsdl:definitions>
Currently, such a WSDL won't work with the Java provider in the same way
it does with SOAP. org.apache.wsif.providers.java.WSIFOperation_Java
contains the relevant code.
There getMethods() tries to find methods in the "server" Java class that
correspond to the operations in the WSDL. That method in turn calls
getMethodArgumentClasses() and getMethodReturnClass(). Both of which
don't extract the contained elements from their getMyStuff(Response)
wrappers. As is, methods with the "unwrapped" signature are not found.
Changing that wouldn't be too complicated. What knocked me out, though,
was executeRequestResponseOperation() (executeInputOnlyOperation()
would have to be changed, too). I'm not even sure whether any
un/wrapping would have to be done there.
I take it that for someone familiar with the code (and test cases) the
needed changes may well be trivial. I may have a go at it again, but
for the time being I give Axis's Java transport a try.
Michael
--
Michael Schuerig The Fifth Rider of the Apocalypse
mailto:[EMAIL PROTECTED] is a programmer.
http://www.schuerig.de/michael/