Thanks for your reply. I added your suggestion to the
Fast3KObjectSoap_Fast3KObjectSoap_Client
(see code and output below) . Unfortunally the "any" object can't be cast
to an EstateObject. Is the problem with the wsdl? The webservice is created
with MS Visual Studio.
Thanks in advance
Roland
----------- code
Fast3KObject ss = new Fast3KObject(wsdlURL, SERVICE_NAME);
Fast3KObjectSoap port = ss.getFast3KObjectSoap();
{
System.out.println("Invoking getObject...");
java.lang.String _getObject_objectNo = "547200";
se.redpill.alfresco.module.jkp.wsclient.fast3k.GetObjectResponse.GetObjectResult
_getObject__return = port.getObject(_getObject_objectNo);
System.out.println("getObject.result=" + _getObject__return);
System.out.println("any=" + _getObject__return.any);
EstateObject estateObject = (EstateObject)_getObject__return.getAny();
System.out.println(estateObject);
}
-------------- output
2008-nov-03 21:09:38 org.apache.cxf.bus.spring.BusApplicationContext
getConfigResources
INFO: No cxf.xml configuration file detected, relying on defaults.
Invoking getObject...
[EMAIL PROTECTED]
any=[diffgr:diffgram: null]
Exception in thread "main" java.lang.ClassCastException:
com.sun.org.apache.xerces.internal.dom.ElementNSImpl cannot be cast to
se.redpill.alfresco.module.jkp.wsclient.fast3k.EstateObject
at
se.redpill.alfresco.module.jkp.wsclient.fast3k.Fast3KObjectSoap_Fast3KObjectSoap_Client.main(Fast3KObjectSoap_Fast3KObjectSoap_Client.java:52)
2008/11/3 Daniel Kulp <[EMAIL PROTECTED]>
>
> 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 <[EMAIL PROTECTED]>
> >
> > > 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
> [EMAIL PROTECTED]
> http://dankulp.com/blog
>