cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: How to use the generated classes
Date Mon, 03 Nov 2008 18:50:10 GMT

Not seeing the actual soap message, it's hard to say, but most likely, you 
would do:

EstateObject obj = (EstateObject)result.getAny();

Your schema doesn't "type" the data in the GetObjectResult.   It uses 
an "xs:any".   The code generators map that to an "Object", but at runtime, 
it should be castable into the EstateObject.  

The getAny() call MAY return a JAXBElement that holds the EstateObject.   Not 
really sure.   You would need to try it and see.

Dan


On Friday 31 October 2008 11:46:53 am Roland Carlsson wrote:
> Hi Glen!
>
> I have generated java-files with wsdl2java (see attached wsdl files).
>
> The generated files (also attached) allows me to call the webservice
> (successfully as far as I can see).
> The generated files does not allow me to get any of the content that the
> webservice generates.
>
> How am I supposed to get the values that the webservice return? Am I not
> supposed to use the EstateObject (se attached zipfile) to access the
> returned object from the webservice?
>
> Is it so that wsdl2java can't handle the wsdl?
> Is it so that something is wrong with the wsdl?
>
> The link about wrapper/non-wrapper i didn't understand. Shouldn't wsdl2java
> handle this for me?
>
> Best regards
> Roland
>
>
>
>
> 2008/10/31 Glen Mazza <glen.mazza@gmail.com>
>
> > If I understand your problem correctly (and I may be quite wrong here),
> > you have a JAXB object called "Human" that has a String property
> > (variable) called "Name".  You want to work with Human objects but the
> > web service calls are just giving you names instead.
> >
> > You can probably just create a Human object and initialize it with the
> > name variable that the web service call is returning, if you wish.
> >
> > I would also look more at the wrapper/non-wrapper discussion here:
> > http://cwiki.apache.org/CXF20DOC/wsdl-to-java.html#WSDLtoJava-wrapperstyl
> >e
> >
> > HTH,
> > Glen
> >
> > Roland Carlsson-5 wrote:
> > > _getObject_return is not an EstateObject and gives me no way of getting
> > > the
> > > EstateObject. Wsdl2java has generated an class called EstateObject. But
> > > how
> > > am I supposed to get an instance of it?
> > >
> > > Three questions:
> > > 1) Is there anything wrong with the wsdl that could cause wsdl2java go
> > > banans?
> > > 2) Is there anything wrong with wsdl2java?
> > > 3) Is there anything I have missed, if so please complete the above
> > > example
> > > with the line of code missing.
> >
> > --
> > View this message in context:
> > http://www.nabble.com/How-to-use-the-generated-classes-tp20260653p2026621
> >9.html Sent from the cxf-user mailing list archive at Nabble.com.



-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog

Mime
View raw message