Thanks for your new answer... the URL you give me there is what I was
looking for. I understood that xsd:anyType means literally that, it's
just that I happen to know what will that anyType be, and expected to be
able to build it using the generated classes... anyway, it will be
easier to read that tutorial to get some ideas clear.
Regards,
David
Philipp Leitner escribió:
"I was just wondering if there were any other kind
of diagram more useful for this purpose"
Well, if the issue is having a number of classes (data structures) and trying
to understand how they relate to each other then I would say class diagrams are
basically the best visualization you can currently have.
"> I've read
http://ws.apache.org/axis2/1_3/userguide-creatingclients.html#createclients
but there aren't many details like, for example, this issue with
OMElement. Where could I find a deeper explanation about using Axis2 and
it's databinding capabilities, and maybe more examples?"
I probably should have explained that in more detail. Your xsd:anyType is
basically a placeholder for some undefined XML content. Compare it to a Java
interface like 'Object invoke(Object parameter)'. Just from looking at the
interface (or, in your case, the WSDL description) neither you nor any tool in
the world can tell what /kind of/ object you will be passed. Basically, you
would have to ask the original developer what he actually wanted to do with
this method. From the point of static type safety this method is entirely
undefined.
The same goes for your WSDL description - xsd:anyType says 'there's gonna be
some XML content here, but I am not going to tell you what it looks like'.
Therefore Axis2 is unable to create a Java type for this content. The only
thing Axis2 is able to do is to hand /you/ (i.e., the client) the XML document
and hope that you know (for instance, because you have talked offline to the
service provider) what to do with this undefined bunch of data. And this is
exactly what happens - you can receive a OMElement (an OMElement is just a
AXIOM representation of a XML (sub-)tree), but unlike other fields you would
have to deal with the XML data yourself in this special case. Have a look at
http://ws.apache.org/axis2/1_0/OMTutorial.html for a tutorial on how to work
with AXIOM.
/philipp
-------- Original-Nachricht --------
Datum: Tue, 05 Feb 2008 14:15:41 +0100
Von: [EMAIL PROTECTED]
An: [email protected]
Betreff: Re: Basic tips for a newbie, problems with really complex types
It's my fault for not having explained a bit more... I had thougth
about making UML diagrams... I was just wondering if there were any
other kind of diagram more useful for this purpose... thanks for your
advice regarding this anyway...
I've read
http://ws.apache.org/axis2/1_3/userguide-creatingclients.html#createclients
but there aren't many details like, for example, this issue with
OMElement. Where could I find a deeper explanation about using Axis2
and it's databinding capabilities, and maybe more examples?
Thanks for your answers.
Philipp Leitner <[EMAIL PROTECTED]> wrote:
"1º The types are a bit too complex and I find sometimes lost"
You could use some kind of 'source code to class diagram' wizard to
visualize your data structures after you have generated your stubs
using wsdl2java (I think there is a good one as plugin for Ecipse).
Or you could use a tool such as Altova XMLSpy to directly visualize
your XSD files.
"2º In one of the xsd I have this definition:"
Your XSD file represents an xsd:anyType type. Basically that means
that about everything can come along at this point in the Web
service message. Axis2 has no way whatsoever of figuring out what
this data will look like BEFORE it actually receives a request.
That's bad news, because it means that you cannot cast it to a
class. You have to directly deal with this data on XML (or more
accurately, on AXIOM) level.
hth, philipp
"
Hi, I've just started a WS client and I chose axis2 because I had to do
a little web service server and client and I used axis 1.4 with no
troubles at all.
This is something a bit bigger, since I'm not at college anymore, and I
have two problems. I've been given a huge wsdl and two xsd files
defining some types used for the ws. I've used wsdl2java to generate
code (using adb bindings... I could switch to something a bit more
complex if there were any advantates regarding my current issues), but:
1º The types are a bit too complex and I find sometimes lost, not
knowing how to build a single object for a request... Do you make any
kind of diagrams when dealing with such a large hierarchy of types?
2º In one of the xsd I have this definition:
<complexType name="QueryExpressionType" mixed="true">
<sequence>
<any namespace="##other" processContents="lax"/>
</sequence>
<attribute name="queryLanguage" type="rim:referenceURI"
use="required"/>
</complexType>
and the generated class QueryExpressionType has an attribute:
/**
* field for ExtraElement
*/
protected org.apache.axiom.om.OMElement localExtraElement;
How can I cast this to the class representing the actual data in the
message?
Thanks for your time.
I think I should add the files I mentioned before:
--- I omit the files in this reply because of the size of the message
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]"
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]