Here is a self-contained example of one way to generate value objects from the SOAP schema (_without_ a binding file).
 
This example generates value objects from the SOAP schema and also has marshalling/unmarshalling.
Go to this URL; unzip the .jar file attached at the very end of the page.
 
http://www.mail-archive.com/[EMAIL PROTECTED]/msg09658.html
-----Original Message-----
From: John Weir [mailto:[EMAIL PROTECTED]
Sent: Sunday, March 16, 2003 6:38 AM
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] Problem Unmarshalling Soap-envelope using Castor

Sharma,
 
I think your4 problem relates to the fact that the Elements and Types both resolve to the same class file. (Check this by cleaning the output running the generator without the -f flag) .
 
You can solve this quite easily by using the binding file to add a suffix to the names of the complex types. You need to pass a binding file similar to the one below to make this work ( add -binding-file to the source generator command line)
 
This will mean that the Element 'Header' will map to Header.java and ComplexType 'Header' will map to HeaderType.java
 
HTH
 
John
 

<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XML Spy v4.4 U (http://www.xmlspy.com)-->
<binding xmlns="http://www.castor.org/SourceGenerator/Binding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.castor.org/SourceGenerator/Binding c:\castor\src\main\org\exolab\castor\builder\binding\binding.xsd">
 <namingXML>
  <complexTypeName>
   <suffix>Type</suffix>
  </complexTypeName>
 </namingXML>
</binding>

-----Original Message-----
From: simmi sharma [mailto:[EMAIL PROTECTED]
Sent: 16 March 2003 09:12
To: [EMAIL PROTECTED]
Subject: [castor-dev] Problem Unmarshalling Soap-envelope using Castor

Hi,

I am not able to compile the Java files, which I get after unmarshalling Soap-envelope xsd file using Castor.I am using this soap-envelope schema:

http://schemas.xmlsoap.org/soap/envelope/

When I create java files, these files have problem that the header, envelope and body file have circular referencing. It is like "Header extends Header". To solve this I tried removing type="tns:Envelope" from 

 <xs:element name="Envelope" type="tns:Envelope"/>

The number of compilation errors reduced but still it does not work. Another thing I noticed that the java files created do not have marshalling/unmarshalling methods.

Am I using the wrong file? I could do Marshalling/unmarshalling with a lot of other files, but i don't know why this is not working.

Any help is appriciated.

-Simmi.

 

Reply via email to