I looked this up in BugZilla but couldn't find
anything on it.
I'm trying to run the SOAP schema
(http://schemas.xmlsoap.org/soap/envelope/) through
Castor v0.9.4.3. (This should be replicatable by
anyone, hopefully, since I'm using the publicly
available schema).
I have a binding file to put suffixes/prefixes on some
of the generated files because the SOAP schema uses
the same name for elements and complex types (Header,
Body, detail to name a few).
My first binding file used <complexTypeName> - when it
didn't work, I used <elementName>, but that didn't
work either.
The first binding file I used was:
<?xml version="1.0" encoding="UTF-8"?>
<binding>
<package>
<name>soap</name>
<namespace>http://schemas.xmlsoap.org/soap/envelope/</namespace>
</package>
<namingXML>
<complexTypeName>
<prefix>Prefix</prefix>
<suffix>Suffix</suffix>
</complexTypeName>
</namingXML>
</binding>
I run the generator via Ant like this:
<java
classname="org.exolab.castor.builder.SourceGenerator"
fork="false">
<classpath refid="classpath" />
<arg line="-i soap.xsd -dest ./src -verbose
-binding-file ${binding.file}" />
</java>
But the generated code is bad and will not compile.
Specifically, I am getting the following two classes
generated in the anonymous, default Java package! They
should have gone in the "soap" package which is what
my binding file specified:
Detail.java
DetailDescriptor.java
In the soap package, I do see a
"PrefixdetailSuffix.java" and
"PrefixdetailSuffixDescriptor.java". This is for the
complex type "detail" found in the SOAP schema - I
think the Detail.java is for the element "detail" (see
the schema for the syntax).
I then tried to use "elementName" instead:
<namingXML>
<elementName>
<prefix>Prefix</prefix>
<suffix>Suffix</suffix>
</elementName>
</namingXML>
but when I generated the code I got similar (though
not exact) results. Again I got two classes in the
default Java package, not "soap" as expected - they
were:
PrefixdetailSuffix.java
PrefixdetailSuffixDescriptor.java
I think this is for the element "detail" from the
schema. In the soap package, I got a bunch of
generated files whose filenames looked correct. But
the code is not compiling. There are a bunch of
private member variables that are defined like this
(from Envelope.java for an example):
/**
* Field _prefixprefixHeaderSuffixSuffix
*/
private soap.PrefixPrefixHeaderSuffixSuffix
_prefixprefixHeaderSuffixSuffix;
Notice it is duplicating the prefix string and suffix
string. There are no classes generated like that,
however, there is a generated class
"soap.PrefixHeaderSuffix".
There are a bunch of variable declarations where these
prefix and suffix strings are duplicated.
In order to replicate this, I think all you need to do
is get the publicly available SOAP schema from the URL
mentioned above in this email and use the binding XML
that I have above. Unless I'm doing something way off
base (never count that possibility out ;-) I think
this points to a problem in the Castor generation
code.
Can anyone verify this behavior on their systems?
Thanks for any help.
John Mazz
__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev