On Thursday 16 December 2010 5:28:47 am meteora28 wrote:
> Hello there,
>
> here is my Problem:
>
> I am implementing a web service from the following WSDL:
> http://www.onvif.org/onvif/ver10/device/wsdl/devicemgmt.wsdl
>
> I executed the method "GetDeviceInformation" with soapUI. There were no
> problems.
> The method has no parameters and some return values.
>
> So I translated the WSDL to Java code. I wanted to execute the same methods
> and the translated class shows me no return value. Instead of there are now
> parameters to set, defined as these values which should be returned. Other
> methods worked fine.
>
> Is it possible that the WSDL wasn't correctly translated to Java code?
This is completely correct as per JAX-WS specifications. When unwrapping the
method, if there are multiple returns, they are each added as params by using
a Holder object. You would create the holders, make the call, and the
holders would then have the objects on return.
You CAN use a JAX-WS binding customization file to tell it to use a
"bare"mode. Pass a file like the following using the -b flag to wsdl2java:
<jaxws:bindings
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns="http://java.sun.com/xml/ns/jaxws"
wsdlLocation="devicemgmt.wsdl"
xmlns:jaxws="http://java.sun.com/xml/ns/jaxws">
<jaxws:enableWrapperStyle>false</jaxws:enableWrapperStyle>
</jaxws:bindings>
Dan
> An other annotation: CXF (current version) was the only "framework" that
> was able to translate the WSDL to Java code because the given has no
> service element.
>
> I hope that somebody knows a solution or a hint ;-)
>
> Kind regards,
>
> meteora28
--
Daniel Kulp
[email protected]
http://dankulp.com/blog