Generate XSD from java class

Hi all,
Is there any tool that can generate an XSD from either a java code file or a byte code file?
Thanks in advance,
Asaf

I've never used it, but the Castor project also provides such a tool...at least that what it says in its FAQ:
http://www.castor.org/xml-faq.html#Is-there-a-way-to-automatically-create-an-XML-Schema-from-an-XML-instance?

Similar Messages

  • Generate XML Schema from Java classes?

    Hi,
    Considering an XML Mapping, i would like to generate a default XML Schema from my Java class.
    Is there a tool in toplink (10.1.3) to do that or does anyone have an easy way to generate this XML schema?
    Thanks,
    Ludovic

    Hi Ludovic,
    We don't have support for schema generation from Java classes in TopLink 10.1.3. It's required for JAXB 2.0 so it will be available in a future release.
    --Shaun                                                                                                                                                                                                                                                                                                                                                                           

  • Parse errors while creating a Web service from Java class!

    Can anybody tell me please, is it possible to create a Web Service from java class where the input from user is required ?
    I have the following program, which is successfully compiled, but when I'm trying to make a web service in JDeveloper, the following error occurs:
    "Validation failed.
    The implementation class primePackage.isPrime ofport type MyWebService contains parse errors."
    import java.io.*;
    import java.util.*;
    class isPrime
    public static void main (String args[])
    Scanner reader = new Scanner(System.in);
    int n;
    System.out.println ("Enter a number you want to know is it prime or not");
    n=reader.nextInt();
    if (isPrime(n))
    System.out.println ("True");
    else
    System.out.println ("False");
    static boolean isPrime (int n)
    int i=2;
    while (i<=n-1)
    if (n%i==0)
    return false;
    i++;
    return true;
    }

    Hi,
    Can anybody tell me please, is it possible to create
    a Web Service from java class where the input from
    user is required ?Yes, the parameters of your method will be mapped in WSDL.
    But i've some considerations about your code.
    I suggest you change the name of isPrime do Prime, its a good code convention to put the name of class starting with Upper case. and isn't good the name of class equals to name of method.
    I suggest you to change the "static boolean isPrime (int n)" to "public boolean isPrime(int n)" to publish a method as a WebService method it's must be public and not static. After this change try to generate your Web Service.
    Regards.

  • Web Service From Java class, serialization problem

    Hi,
    I want to create Web Service from Java class, I made java project, generated web service from it, create web service archive project and deployed it to WAS 6.40.
    My class have 2 methods,
    public int add(int a, int b);
    public MyResponse doSomthing(MyRequest req);
    I can succesfully call add method from Web Service Navigator, it works fine but when I call doSomthing methods I get the following error:
    <b>
    Deserializing fails. Nested message: XML Deserialization Error. Result class [com.mycomp.sap_tech.ws.MyRequest] does not have property [Amount] of type [java.lang.String]. It is required to load XML..
    </b>
    Any ideas how to resolve it?
    P.S. MyRequest class is exposed throw VI, has default constractor and public getters and setters for all properties. It implements Serializable as well. Any guesses?
    Thanks in advance,
    Victor.

    Hi Bhavik, thanks for response.
    as I already mentioned it implements Serializable, so it is not the problem.
    Thanks Avi but it didn't helps iether
    Victor

  • WEB SERVICE FROM JAVA CLASS

    Hi,
    I'm new to BPEL and I've a problem: i need to create a WEBSERVICE from Java class.
    This Java class contain functions to call other functions in other packages.
    These last function contain sql query: it's an java "interface" application between BPEL and an EXTERNAL Oracle database 10g.
    I want to create one WEB SERVICE from this application and i followed the steps (right click, menù, create j2ee webservice, etc) i obtain error:
    VALIDATION FAILED --- Files at the following URLs cannot be modified:
    File:/C:/OraBPELPM1/integration/jdev/jdev/mywork/RichiesteWebService/ARRICH/app/src/controller/MyWebService1.webservice
    File:/C:/OraBPELPM1/integration/jdev/jdev/mywork/RichiesteWebService/ARRICH/app/src/controller/IMyWebService.wsdl
    File:/C:/OraBPELPM1/integration/jdev/jdev/mywork/RichiesteWebService/ARRICH/app/src/controller/MyWebService1.dd
    Show the java class "interface":
    package controller;
    import java.util.*;
    import java.sql.*;
    import domain.*;
    import dao.*;
    import utility.*;
    public class Request_Incoming_Controller {
    public Request_Incoming_Controller() {}
    /* Update StatoTurismo */
    public static String aggiornaStTurismo(int numIncoming, String tur) {
    GregorianCalendar dp = FormatoData.dataDaDate1("00/00/0000");
    Request_Incoming ric = new Request_Incoming(numIncoming,"","",dp,dp,"","","",0,"",tur,"");
    // try {
    if(ric.aggiornaTurismo()<0)return "NO";
    return "OK";
    // } catch (SQLException ex) {
    // System.err.println("Eccezione durante l'aggiornamento "
    // + ex.getMessage()); }
    /* Update StatoCassa */
    public static String aggiornaStCassa(int numIncoming,String cash) {
    GregorianCalendar dp = FormatoData.dataDaDate1("00/00/0000");
    Request_Incoming ric = new Request_Incoming(numIncoming,"","",dp,dp,"","","",0,"","",cash);
    // try {
    if(ric.aggiornaCassa()<0) return "NO";
    return "OK";
    // } catch (SQLException ex) {
    // System.err.println("Eccezione durante l'aggiornamento "
    // + ex.getMessage()); }
    /* Lettura del NumIncoming assegnato dal sistema dopo il caricamento della
    * richiesta in base alla matricola del Dipendente
    public static int caricaNumDaDip(String dipendente){
    Request_Incoming ric = new Request_Incoming(0,dipendente);
    // try {
    ric.trovaNumIncoming();
    return ric.getNumIncoming();
    // } catch (SQLException ex) {
    // System.err.println("Eccezione durante l'aggiornamento "
    // + ex.getMessage()); }
    Can Anyone help?
    Is urgently.........thanks
    Daniele

    You should try to post it there:
    http://forums.oracle.com/forums/forum.jspa?forumID=97
    But if I look at the error, it looks like some files are Read-Only. Maybe you should check if they are or if you have the appropriate rights on the folder.
    Good luck

  • How to set classpath from java class ??

    I have tried to use System.setProperty("java.class.path", "my class path string ") to set classpath dynamically. But it is not working. How to set it dynamically from java class ?? Thanks , gary

    Look into the java.net.URLClassLoader. You can't set the classpath after the fact but you can specify URL's that will checked when you try to load a class with that loader.

  • Calling Servlet from Java Class in eclipse

    Hi ,
    I am calling a Servlet from JAVA Class as I am using IDE: Eclipse. The Problem is below
    URL url = new URL(ServletPath);
    URLConnection connet = url.openConnection();
    I am using the above code in JAVA to Connect to Servlet I have given Print statement in Servlet such that whenever it calls it prints on Console but when I try to run the code the Statement is not printed in the Console of eclipse I think URL connection is not able to establish any connection ..... if any has solution for this please reply
    Thanks & Regards,
    Arvind

    I am calling a Servlet from JAVA Class as I am using IDE: Eclipse. The Problem is below
    URL url = new URL(ServletPath);
    URLConnection connet = url.openConnection();Why should the Servlet running in different Runtime print on your Eclipse Runtime. Please be more clear about the question.

  • JCX access from java class

    Is it possible to access jcx from java class ?
    from jpf i am calling java class which inturn calls jcx and
    i am getting nullpointer exception at jcx call in java class
    waiting for solution...
    thanks,
    sridhar

    Shrishar,
    Unfortunately in the current release controls cannot be accessed from stand
    alone java classes. You can create a custom control which can invoke the jcx
    and be invoked from within the jpf.
    Regards,
    Raj Alagumalai
    Backline Workshop Support
    "sridhar" <[email protected]> wrote in message
    news:4083d449$[email protected]..
    >
    Is it possible to access jcx from java class ?
    from jpf i am calling java class which inturn calls jcx and
    i am getting nullpointer exception at jcx call in java class
    waiting for solution...
    thanks,
    sridhar

  • Calling OAM WLST Commands from java class

    Hi all,
    is there any idea how to call OAM related WLST commands from java class ?.
    what are the required jar files ?
    thanks

    Hi,
    As per my understanding in OAM you will have only two major .py file startscript.py and stopscript.py file which will start nodemanger connect and start Admin and managed server similarly in stop it will stop managed server Admin server and then last nodemanager.
    these all done through wlst command using nmConnect(), nmStart (), nmKill() and shutdown etc.
    What exactly you are looking to get from java code.
    Regards,
    kal

  • AR60RUN from Java class

    Can we run a oracle report 6i from java class ? Is there a JAVA API available for this ? I tried using "ar60run" thro getRuntime().exec java API, but its giving a core dump.. any suggestions ?

    You don't need to extend from Frame if you're creating an Applet. The Applet Class is a Container so you can anything you can add to a Frame to an Applet. With an Applet you must call either init(), start() or paint(Graphics g). There is a really good description of how to create your first Applet in the Java Tutorial. It also give a demo of how to set up a web page to contain your applet and how to use the appletviewer.
    http://java.sun.com/docs/books/tutorial/getStarted/applet/index.html
    Basically what you need to do is:
    import java.applet.Applet;
    import java.awt.*;
    public class MyApplet extends Applet {
    public void init() {
    setSize(500,500);
    // Add Components, Listeners, etc...
    Button b = new Button("MyButton");
    add(b);

  • How can i open the popup from java class

    Hi,
    Please tell me how can i open the popup from java class.
    I am using jdev 11.1.1.7.0
    I have used the below code which works fine in jdev 2.1 but it will have some errors in 11.1.1.7.0.
    Please tell me some way to do this in all jdev versions.
    Bean obj = (Bean)RequestContext.getCurrentInstance.getExternalContext.getPageFlowScope(“obj”);
    Code for hide pop-up
    FacesContext context = FacesContext.getCurrentInstance();
    String popupId = obj.getPopUpBind().getClientId()
    ExtendedRenderKitService service = Service.getRenderKitService(FacesContext.getCurrentInstance(),
    ExtendedRenderKitService.class);
    String hidePopup = "var popupObj=AdfPage.PAGE.findComponent('" + popupId +
    "'); popupObj.hide();";
    service.addScript(FacesContext.getCurrentInstance(), hidePopup);
    Code to Show pop-up
    StringBuffer showPopup = new StringBuffer();
    showPopup.append("var hints = new Object();");
    showPopup.append("var popupObj=AdfPage.PAGE.findComponent('" +
    obj.getPopUpBind().getClientId() + "');popupObj.show(hints);");
    service.addScript(FacesContext.getCurrentInstance(), showPopup.toString());
    Code need to be added in jsff pop tag
    binding="#{pageFlowScope.bean.popUpBind}
    Variable need to be added in Bean.java
    private RichPopup popUpBind;

    Hari,
    Since you're using a non-public build of JDeveloper, you should be using a non-public forum.
    John

  • How To Change Resource Bundle file's data from Java Class

    Hi
    i have used below code for accessing Resource Bndle from Java Class but here i also want to make change in a particular key and its value.
    please let me know the code i should use to make changes in Resource Bundle file's key and value and saving the same in the file.
    package test;  import java.util.Enumeration;
    import java.util.ResourceBundle;
    public class ResourceBundleTest {
    public static void main(String[] args) {
    ResourceBundle rb = ResourceBundle.getBundle("test.bundletest.mybundle");
    Enumeration <String> keys = rb.getKeys();
    while (keys.hasMoreElements()) {
    String key = keys.nextElement();
    String value = rb.getString(key);
    System.out.println(key + ": " + value);
    Thanks

    With further debugging, I noticed the following line only works in integrated WLS but not in standalone WLS
    resourceBundle = ResourceBundle.getBundle("com.myapp.MyMappings");
    I confirmed the corresponding properties file was included properly in the EAR file but the standalone WLS failed to find the properties file at runtime.
    Why did the standalone WLS class loader (must be the same as the integrated WLS) failed to find the properties file deployed under the WEB-INF/classes path in the EAR file?
    The above line was in a POJO class which has the same classpath as the properties file ie. com.myapp.MappingManager.class.
    It was strange that the class loader could load the POJO class but unable to find the com.myapp.MyMappings.properties in the same classpath!!!
    Is this a bug in standalone WLS?
    Edited by: Pricilla on May 26, 2010 8:52 AM
    Edited by: Pricilla on May 26, 2010 9:01 AM

  • Generating database tables from Java classes

    Hi,
    I've encountered a number of tools which will create Java classes from database tables (e.g. JDeveloper has this functionality, Abator provides this for iBATIS, etc...).
    However, I've not been able to locate any tools that perform the opposite job - i.e. given a Java class, it generates a database table (or, presumably, some SQL).
    It's been suggested to me that Hibernate might provide this sort of capability, but if anybody has any experience of doing this, in any tool, I'd be interested to hear about it.
    Thanks,
    Alistair.

    Many thanks for the pointers.
    duffymo: I've taken a look at Middlegen (http://boss.bekk.no/boss/middlegen/index.html) but it seems that the first step is to specify the database schema, whereas I'm looking to generate the schema from existing code. Or have I missed something?
    Alistair.

  • How to display value from java class with output generated with toplink

    i hava a requirement of displaying (distance ie calculated in java class) with output generated by query.
    ie if output is like
    school name (distance)
    physical address
    here the school name and physical address are retrived from database.

    Hi,
    ValueHolders are used by the JSF internal framework. To work with an object (attributes) in a managed bean you don't need to make it returning a value holder.
    Create a POJO, provide accessor methods and register it as a managed bean. Access it from JSF with EL
    Frank

  • Generate IDL from Java Code, Classes, UML, etc?

    Hi,
    is is possible to generate IDL code from Java Code, Classes, UML, ... using JDeveloper?
    I know this is somewhat reverse engeneering, but it would speed up the migration of our existing Java project...
    Thanks,
    Johan

    Hi,
    is is possible to generate IDL code from Java Code, Classes, UML, ... using JDeveloper?
    I know this is somewhat reverse engeneering, but it would speed up the migration of our existing Java project...Unfortunately it does not. The IDL to Java conversion is handled under the covers by the idl2java.exe included with the database. You might want to search on google for a IDL generator from java source.
    java2iiop (another tool) just generates IIOP stubs from classes and interfaces, but I don't think it creates IDL.
    Rob

Maybe you are looking for

  • Shuffle isn't recognized through USB 2.0 card

    My 1st Gen Shuffle is perfectly functional when I plug it into one of the USB 1.1 ports on my PB, but unfortunately, when I connect the Shuffle to one of the ports of a USB 2.0 card inserted in my PB, the Shuffle does not appear in iTunes or anywhere

  • Mac starts up by itself at 1 am some nights... Can anyone help me stop this from happening based on reading my system log messages?

    My Mac starts itself automatically around 1:00 am about ever other night. I don't want it to do that. I had a backup program installed once that was set to do the backup at that time, but I have long since uninstalled that program. Yet the computer s

  • How do I disable Download Option on .Mac Web Gallery

    I created my pages on .Mac Web Gallery with iweb from my iphoto albums yesterday. At that time I chose to enable viewers to download these photos. I have changed my mind and now want to disable the downloading option. How do I do this with out having

  • Why won't my Macbook charge a battery???

    I bought a battery on ebay a few months back when I thought I was buying a macbook from another guy with a bad battery macbook. It has sat out for a few months but it only shows having 3 cycles in the "about this mac" page. It was new as of a few mon

  • Dropped my ipod nano 4th gen

    ok last night I dropped my Ipod nano 4th gen without a case on my tile floor. It was about a 3-4 feet drop. So today I was running and than after a couple mins of running with the song still playing my ipod buttons froze, nothing worked the screen re