Thanks for the reply, but I would like to get the XSD from a java bean.
Is this possible with those tools? Anyone seen this done?

-----Original Message-----
From: Kameshwar Jayaraman [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, January 14, 2003 4:05 PM
To: [EMAIL PROTECTED]
Subject: RE: Has anyone used the axis APIs to generate XSD from Java?
Something like java2XSD?

Jason,

You can use JAXB,Castor like to get the Java From a XSD.

Hope that helps.

Thanks

Kamesh

-----Original Message-----
From: Jason Weinstein [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, January 14, 2003 10:36 AM
To: [EMAIL PROTECTED]
Subject: Has anyone used the axis APIs to generate XSD from Java?
Something like java2XSD?

Has anyone used the axis APIs to generate XSD from Java? Something like
java2XSD?
Is anyone aware of another tool which can do it?

Axis certainly has the capability, but there appears to be no
straightforward way to do it.

Ideally I'd like a command line interface.


Class:
org.apache.axis.wsdl.fromJava.Types

Constructor:
org.apache.axis.wsdl.fromJava.Types(javax.wsdl.Definition def,
TypeMapping tm, TypeMapping defaultTM, Namespaces namespaces,
java.lang.String targetNamespace, java.util.List stopClasses)

Class:
org.apache.axis.encoding.Serializer.writeSchema(Types)

Class:
org.apache.axis.wsdl.fromJava.Emitter

Snippet:
Definition def;
// The input wsdl types section is deleted.  The
// types will be added back in at the end of processing.
def.setTypes(null);

..

// Write out the interface def
Document doc = WSDLFactory.newInstance().
        newWSDLWriter().getDocument(intf);
types.insertTypesFragment(doc);


This is similar to what I want as a result. Namespaces have to be
handled.

  <schema xmlns="http://www.w3.org/2001/XMLSchema";
targetNamespace="urn:QRS">
   <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
   <complexType name="Result">
    <sequence>
     <element name="name" nillable="true" type="xsd:string"/>
     <element name="value" type="xsd:double"/>
    </sequence>
   </complexType>
   <complexType name="ArrayOfResult">
    <complexContent>
     <restriction base="soapenc:Array">
      <attribute ref="soapenc:arrayType"
wsdl:arrayType="impl:Result[]"/>
     </restriction>
    </complexContent>
   </complexType>
   <element name="ArrayOfResult" nillable="true"
type="impl:ArrayOfResult"/>
  </schema>

Reply via email to