Hi, We are using the SourceGenerator class to generate classes from an XML schema definition.
SourceGenerator is generating abstract classes (without the marshal() methods) if we use a schema of the following format: <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://tempuri.org/"> <s:complexType name="paymentType"> <s:sequence> <s:element name="currency" type="s:string" /> <s:element name="amount" type="s:integer" /> <s:element name="mode" type="s:string" /> </s:sequence> </s:complexType> <s:simpleType name="stateCode"> <s:restriction base="s:string"> <s:length value="2" /> </s:restriction> </s:simpleType> <s:complexType name="addressType"> <s:sequence> <s:element name="Name" type="s:string" /> <s:element name="Street" type="s:string" /> <s:element name="City" type="s:string" /> <s:element name="State" type="s0:stateCode" /> <s:element name="PostalCode" type="s:integer" /> </s:sequence> </s:complexType> <s:complexType name="purchaseOrder"> <s:sequence> <s:element name="shipTo" type="s0:addressType" /> <s:element name="billTo" type="s0:addressType" /> <s:element name="shipDate" type="s:date" /> <s:element name="item" type="s:string" /> </s:sequence> </s:complexType> </s:schema>. If we modify the schema as follows (basically wrapping each complexType tag in and element tag), the classes are not abstract. <?xml version="1.0" encoding="UTF-8" ?> <xsd:schema targetNamespace="http://tempuri.org/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s0="http://tempuri.org/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="PaymentType"> <xsd:complexType> <xsd:sequence> <xsd:element name="currency" type="xsd:string" /> <xsd:element name="amount" type="xsd:integer" /> <xsd:element name="mode" type="xsd:string" /> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:simpleType name="StateCode"> <xsd:restriction base="xsd:string"> <xsd:length value="2" /> </xsd:restriction> </xsd:simpleType> <xsd:element name="AddressType"> <xsd:complexType> <xsd:sequence> <xsd:element name="Name" type="xsd:string" /> <xsd:element name="Street" type="xsd:string" /> <xsd:element name="City" type="xsd:string" /> <xsd:element name="State" type="s0:StateCode" /> <xsd:element name="PostalCode" type="xsd:integer" /> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="PurchaseOrder"> <xsd:complexType> <xsd:sequence> <xsd:element name="shipTo" type="s0:AddressType" /> <xsd:element name="billTo" type="s0:AddressType" /> <xsd:element name="shipDate" type="xsd:date" /> <xsd:element name="item" type="xsd:string" /> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema> Any idea why this is happening ? We really need to generate non-abstract complex type classes. After looking at the SourceFactory.createSourceCode() method, I'm tempted to just comment out the line that sets the abstract flag on the class, but I'm not sure what the ramifications of this would be. Any help is this area would be greatly appreciated. Thanks. Nancy Beers Senior Software Engineer Hewlett Packard Co. ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev
