• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 6222
  • Last Modified:

Java to XSD conversion

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;
}
}

TestInput
has setter/getters methods name/address

TestOutput
Has setters/getters methods for String results

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

0
srivenky
Asked:
srivenky
1 Solution
 
hoomanvCommented:
Look at JAXB, which has a tool called schemagen that might do what you need.
https://jaxb.dev.java.net/nonav/jaxb20-ea/docs/schemagen.html
0
 
Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
There are two good ways one is  Apache XMLBeans, other being JAXB.

http://www.onjava.com/pub/a/onjava/2004/07/28/XMLBeans.html

http://roseindia.net/jaxb/r/jaxb.shtml
0
 
Mayank SAssociate Director - Product EngineeringCommented:
You can download XMLBeans from here:

http://xmlbeans.apache.org/
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
srivenkyAuthor Commented:
shivaspk:
          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.

0
 
Mayank SAssociate Director - Product EngineeringCommented:
Did you try XMLBeans?
0
 
srivenkyAuthor Commented:
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.
0
 
GranModCommented:
PAQed with points refunded (500)

GranMod
Community Support Moderator
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now