Java to XSD conversion

Posted on 2006-04-23
Last Modified: 2008-01-09
I need to convert a class to a XSD. Is there any tool which does this?

For example my class looks something like this.
package com.test;

import com.test.TestInput;
import com.test.TestOutput;

public class TestClass{

public TestOutput testClass(TestInput testInput){
return null;

has setter/getters methods name/address

Has setters/getters methods for String results

When i convert to xsd it should create class details for TestClass, TestInput and TestOutput.

Question by:srivenky
    LVL 14

    Expert Comment

    Look at JAXB, which has a tool called schemagen that might do what you need.
    LVL 23

    Expert Comment

    There are two good ways one is  Apache XMLBeans, other being JAXB.
    LVL 30

    Expert Comment

    You can download XMLBeans from here:
    LVL 3

    Author Comment

              I couldn't find any tool that converts Java class to xsd in XMLBeans. I also tried installing jaxb. The schemagen doesn't work for me..It throws Java Invocatation Target Exception.

    LVL 30

    Expert Comment

    Did you try XMLBeans?
    LVL 3

    Author Comment

    Yes, i tried XMLBeans too. I couldn't find any specific tool for converting a class to XSD in that. Finally i had to use WSAD and manually create schema for each of the classes.

    Accepted Solution

    PAQed with points refunded (500)

    Community Support Moderator

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Suggested Solutions

    Title # Comments Views Activity
    maxMirror challenge 10 68
    bigHeights  challenge 13 43
    array11 challenge 16 40
    countPairs challenge 7 37
    For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
    After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
    Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
    Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now