Thanks Jeff

 

This is certainly one approach. However, there are many, many paths and
they change, making this approach impracticable.

 

I was hoping there's a switch, but I guess Axis2 is calling an XMLbeans
jar directly and passing it's own prefixes via method calls. 

 

It would certainly help if XMLBeans and Axis used the same standards ;)

 

I'll log a bug.

 

 

Thanks

 

Martin

 

 

 

From: Jeff Martin [mailto:jmar...@telecomsys.com] 
Sent: Thursday, March 12, 2009 8:51 AM
To: axis-user@ws.apache.org
Subject: RE: XMLBeans-Axis2 - Type naming differences

 

Martin,

 

The workaround is that you need to specify an .xsdconfig file.  This
lets you take control of how XMLBeans generates package names, rather
then relying on the defaults.  In addition, Axis2's wsdl2java also uses
the .xsdconfig file.

 

You can find the XML schema definitions for the .xsdconfig syntax in
xmlconfig.xsd (this link
<http://svn.apache.org/viewvc/xmlbeans/trunk/src/configschema/schema/xml
config.xsd?view=markup>  is to the web SVN version)

 

You'd have an xsdconfig file something like this:

 

<!-- This file used by XMLBeans, to override some of the defaults -->

<xb:config
xmlns:xb="http://xml.apache.org/xmlbeans/2004/02/xbean/config";>

 

    <xb:namespace uri="http://example.com/testService/2009/03"; >

        <xb:package>com.example.testService.x2009.x03</xb:package>

    </xb:namespace>

 

</xb:config>

 

The above results in exactly the same XMLBeans-generated names as
XMLBeans would generate without the file.  The main reason to have this
file is that you can tell wsdl2java to use these names:

 

   % wsdl2java.sh -d xmlbeans -xsdconfig example.xsdconfig ...

 

Definitely feels like a bug in 'wsdl2java.sh -d xmlbeans', that Axis2
doesn't use the same conventions even though you say '-d xmlbeans'.

 

-- Jeff

 

 

  _____  

From: martin.ba...@wellsfargo.com 
Sent: Wednesday, March 11, 2009 6:16 PM
To: axis-user@ws.apache.org
Subject: XMLBeans-Axis2 - Type naming differences

 

Hello,

I am using Axis2 1.4 and XMLBeans 2.4. I would like to use XMLBeans ant
task to generate all the XMLBeans artifacts and use Axis2 to just
generate the skels and stubs. This is because I have a mix of .wsdl's
and .xsd's I need to generate and would like to normalize the resource
files.

What I've found is, though, that the Axis2 tasks and XMLBeans tasks name
entities differently when a span in the entity path starts with a
number. For example:

Element namespace - com/example/testService/2009/03

Schema - com/example/testService/2009/03/myTestSchema 

XMLBeans generated element -
com.example.testService.x2009.x03.myTestSchema

Axis2 generated element - com.example.testService._2009._03.myTestSchema

Note that XMLbeans prepends 'x' and Axis2 '_' to numeric paths.

This difference changes the resource index mapping making it impossible
to use the separately generated files. 

 

Can anyone tell me how to normalize the naming between Axis2 and
XMLBeans?

 

Thanks in advance,

Martin

 

CONFIDENTIALITY NOTICE: The information contained in this message may be
privileged and/or confidential. If you are not the intended recipient,
or responsible for delivering this message to the intended recipient,
any review, forwarding, dissemination, distribution or copying of this
communication or any attachment(s) is strictly prohibited. If you have
received this message in error, please notify the sender immediately,
and delete it and all attachments from your computer and network.

Reply via email to