Hi Tim,
Ah, I see, so the child OIA element is totally different from
the parent OIA element. Yes, you will encounter the issue you mentioned
because of that :(. When you generate the java code from the xsd, do you
place all the generated classes in the same package?
Maybe splitting up the xsd-java generation so that all the
classes except the child OIA element is generated in a parent package?
Then do a second xsd-java generation for the child OIA element in a
child package, so see if that helps with your compilation issue below
(although I suspect it won't, as you normally have to hand code what
class you are referring to by ensuring one has the full package path?)?
Otherwise, custom binding will probably solve the issue for you.
Have a look at how to do this, via this url:
http://java.sun.com/webservices/docs/2.0/tutorial/doc/JAXBUsing4.html
See header, 'Fix Collides Example', on how to do that mapping. In this
example, there are two elements that share the same name, FooBar. Please
note I have never had to do any of this custom binding myself, luckily!
However, am sure there are others on this mailing list how are better
prepared to help, or might point you to a better example? It's not
really an xfire thing, maybe looking at some jaxb forums might help you
along?
Best of luck with it Tim,
Conor
-----Original Message-----
From: Tim Sawyer [mailto:[EMAIL PROTECTED]
Sent: Thursday, 7 June 2007 8:10 PM
To: [email protected]
Subject: RE: [xfire-user] Generating from WSDL gives compile error
Thanks Conor,
I think the second nested OIA element is different. It's not a
reference to the parent object, it is a different object that just
happens to have the same name. (Bit daft it you ask me, but it's a
commercial service so I have no control.) If I'm reading the XSD right,
the inner OIA has two attributes, UMB and VMB. The outer OIA has OIADEC
and OIAUNDEC inside it.
The inner OIA is deeply nested inside OIADEC.
Given that the xsd I'm generating from is over a megabyte, I'd rather
not start digging in and tweaking the code.
Hmm. Will have a look into the custom binding stuff and see how complex
it is to do.
Thanks again,
Tim.
> Hi Tim,
> I too have an external xsd that I needed to integrate into a web
> service I am developing. In that xsd, there was an element that
> self-referenced itself, similar to the situation you describe below? I
> believe it's similar, in that I am 'assuming' your OIA class below is
> the same (element) in both instances, correct? Well, when converting
> from xsd to java, the classes were converted fine?
> One solution you might want to evaulate before returning to axis
from
> xfire, is to try to define a custom binding to solve your issue below?
> So when converting from xsd to java, your OIA element will be mapped
> to say a java class that you hand create?
> That's my two cents Tim, hope it's of some value?
> Best,
> Conor
>
> -----Original Message-----
> From: Tim Sawyer [mailto:[EMAIL PROTECTED]
> Sent: Thursday, 7 June 2007 1:04 AM
> To: [email protected]
> Subject: [xfire-user] Generating from WSDL gives compile error
>
> Hi Folks,
>
> I'm trying to generate an XFire client to a very large credit
> reference web service. I've been provided with wsdl and xsd files,
> and have run the WsGen program. (I am completely new to XFire, having
> used jibx-soap in the past. I'm trying xfire because I need to be
> able to call an external service - we've only previously used
> jibx-soap for
> internal->internal
> calls.)
>
> Unfortunately the generated files have a handful of compile errors.
>
> The errors seem to be caused by having attributes within classes where
> the attribute name is the same as the class name. So, in the
> generated ObjectFactory.java, I have references such as:
>
> public CTOutputBSB.APPLICANT.OIA.OIADEC.ER.OIA
> createCTOutputBSBAPPLICANTOIAOIADECEROIA()
> {
> return new CTOutputBSB.APPLICANT.OIA.OIADEC.ER.OIA();
> }
>
> which has an error because the static class OIA (at the end of this
> chain) hides the previous OIA from further up. The error I get in
> Eclipse where the second OIA class is defined is "Nested type OIA
> hides an enclosing type." I thought this might be only an eclipse
> warning, but it doesn't seem to be one I can turn off. Looking at the
> xsd I do have <xs:element name="OIA" minOccurs="0"> with a <xs:element
> name="OIA"> deep inside it.
>
> How can I fix this? I obviously have no control over the wsdl/xsd.
> Am I doomed to try Axis again? :-)
>
> ta,
>
> Tim.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
> http://xircles.codehaus.org/manage_email
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> This email (including any attached files) is for the intended
> recipient(s) only. If you received this email by mistake, please, as a
> courtesy, tell the sender, then delete this email.
>
> The views and opinions are the originator's and do not necessarily
> reflect those of the Queensland Studies Authority. All reasonable
> precautions have been taken to ensure that this email contained no
> viruses at the time it was sent.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email (including any attached files) is for the intended
recipient(s) only. If you received this email by mistake, please,
as a courtesy, tell the sender, then delete this email.
The views and opinions are the originator's and do not necessarily
reflect those of the Queensland Studies Authority. All reasonable
precautions have been taken to ensure that this email contained no
viruses at the time it was sent.
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email