You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by meteora28 <s....@web.de> on 2010/12/16 11:28:47 UTC

WSDL->Java - Wrong Translation?

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?

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
-- 
View this message in context: http://cxf.547215.n5.nabble.com/WSDL-Java-Wrong-Translation-tp3307704p3307704.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: WSDL->Java - Wrong Translation?

Posted by meteora28 <s....@web.de>.
Hello Glen,

thanks for your answer.

When you look at the source code of the weblink I posted, you can see the
code of the wsdl.
The presentation is changed through the xsl-transformation in line 2.

<?xml-stylesheet type="text/xsl"
href="http://www.onvif.org/onvif/ver20/util/onvif-wsdl-viewer.xsl"?>

I got only this wsdl file. That means the service is given and I want to
implement a client.

meteora28
-- 
View this message in context: http://cxf.547215.n5.nabble.com/WSDL-Java-Wrong-Translation-tp3307704p3307985.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: WSDL->Java - Wrong Translation?

Posted by Glen Mazza <gl...@gmail.com>.
That is not a WSDL, but a text description of a WSDL that makes it 
difficult to see what the problem is.  Your service provider should be 
providing you an actual WSDL to work with.

If you have an actual WSDL (which will something like this[1]), you can 
create a SOAP client[2] from it using either CXF or Metro and then 
report back the problems, if any, you have.  (When you say you 
"[manually?] translated the WSDL to Java code" I'm not sure what you 
did--CXF has a WSDL2Java tool for automatically doing that.

HTH,
Glen

[1] http://www.jroller.com/gmazza/entry/web_service_tutorial#WFstep4
[2] http://www.jroller.com/gmazza/entry/soap_client_tutorial


On 16.12.2010 05:28, 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?
>
> 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


Re: WSDL->Java - Wrong Translation?

Posted by meteora28 <s....@web.de>.
Thanks!

That helped me.

=)
-- 
View this message in context: http://cxf.547215.n5.nabble.com/WSDL-Java-Wrong-Translation-tp3307704p3309123.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: WSDL->Java - Wrong Translation?

Posted by Daniel Kulp <dk...@apache.org>.
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
dkulp@apache.org
http://dankulp.com/blog