Can I expose existing java applications as webservices

I have some java based applications doing functions such as datamining, visualization ... Can I expose these as webservices? How to do that? Can I directly expose it as webservices? What tools should I use? Please explain.
Thanks

basically, if you have a java application doing stuff, you can create a webservice by writing JSP pages and beans and/or servlets. very simple example:
- write a jsp page for data input that access your bean
- write a bean that routes the request/response to/from your application classes
all you need for doing this is a webserver and a servlet container (e.g. tomcat).
however, if youre application is doing some graphical output, you could split your application in two: a client application for the visualization, which is communication with a servlet or a full blown J2EE server (http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/WCC.html).

Similar Messages

  • Use Sun Java Studio 2 with Existing Java Application

    I have started using Sun Java Studio 2 and having fun and little difficulty creating a new Java web application from scatch. My question is where do I find information on Java Studio configuration to allow Java Studio to load up and modify Java server pages/forms in an existing Java application that I did not write?
    The Java application has been created with Javabeans and using BEA Weblogic version 7, with a SQL-Server 2000 database backend.
    Below is a bit of code out of one of the main Java forms.
    <%@ page buffer="256kb" autoFlush="false" errorPage="../../common/system/error.jsp"
    import="psdi.jsp.beans.*, psdi.jsp.common.*, psdi.jsp.app.wotrack.*, psdi.jsp.util.* , psdi.mbo.* , psdi.util.* "%>
    I have looked around and have not found what I need to setup in Java Studio to allow me to load up a form and view it in the Visual designer, I keep getting errors on the psdi. references and cannot load up any pages.
    I see on the server install ia folder under the main root <DIR> called <apps>, and inside the <apps> folder is a folder called <jsp> and in the <jsp> folder are sub folders for each main module within the application with all the related .jsp files. I have been manually editing the .jsp files using Windows Notpad and saving the changes. Then I rebuild the .ear file and my changes work fine. Since I have a lot of changes to make there has to be a better way than using Notpad.
    My hope is somewhere is a point-by-point document on what to so I can use Sun Java Studio 2 to make my changes in a visual IDE.
    Any assistance would really be appreciated.

    Hi Giri,
    Yep, this I know,b ut when I do I get errors messages and am looking for some form of point-bypoint instuction that better explains how to setup up custom libraries in Sun Java Studio, custom tags, etc.

  • Getting error when trying to expose the java class as webservice

    I am new to webservices and ESB.
    I have two custom schemas. LegacyCustomer.xsd and CommonCustomer.xsd. I am compiling these schemas using JAXP. I am trying to map one custom data to another data using java class. I am trying to expose this java class into webservice.
    public class Test implements Serializable {
    private static final long serialVersionUID = 1L;
    public Test() {
    public CustomerType transform (CustomerDataType custDataType) {
    CustomerType custType = new CustomerType();
    custType.setCustomerId(custDataType.getCustomerId());
    return custType;
    Schemas used are:
    Input Schema:
    <schema targetNamespace="http://xmlns.oracle.com/Esb/CustomerData" xmlns:cust="http://xmlns.oracle.com/Esb/CustomerData" xmlns="http://www.w3.org/2001/XMLSchema">
         <element name="CustomerData" type="cust:CustomerDataType"/>
         <complexType name="CustomerDataType">
              <sequence>
                   <element name="CustomerId" type="string"/>
    </sequence>
         </complexType>
    </schema>
    Output Schema:
    <schema targetNamespace="http://xmlns.oracle.com/Esb/CustomerProvision" xmlns:CU="http://xmlns.oracle.com/Esb/CustomerProvision" xmlns="http://www.w3.org/2001/XMLSchema">
         <element name="Customer" type="CU:CustomerType"/>
         <complexType name="CustomerType">
              <sequence>
                   <element name="CustomerId" type="string"/>
              </sequence>
         </complexType>
    </schema>
    When I try to do this I am getting following error
    CustomerType of method transform cannot be serialized into xml, and no custom serializer has been defined for it.
    Why do we need custom serializer here? And if this is mandatory how can we define this custom serializer?

    Thanks for your reply...
    I tried second option that you specified first. I did the transformation of objects using xslt. It is working fine.
    But I couldn't able to do this using first method...,
    When I tried to compile the schema using jaxp it is actually creating classes without the private variables. and hence it is not able to recognize those variables to generate the wsdl.
    But I am not sure how to generate the classes with those private variables and getter and setters (to generate wsdl specification it seems to be mandatory one).
    Can you please tell me how can we do the schema compilation (other than xml beans and jaxp.... I tried both)?

  • How can I run a java-application on starting of Windows 2000

    How can I run a java-application without any user on starting of Windows 2000?
    For example, if the computer is restarted and nobody enter into it yet, my java-application should run anyway.
    How can I do that?

    Hi, you have to put it in a Windows service.
    To do this you have a program, Srvany.exe that allow to insert a .exe or .bat program in a Windows service.
    For example, i develop a program, TomcatGuardian and i put it in a service because i need to run it in a server without Administrator logged in.
    Regards,
    Ivan.

  • How can i built a java application using java debug class on Log4J

    Hi,
    As java API support the MethodEntryEvent, using which I can get the automatic logging statements when the method is entered or exited as HelloExample.main(with argument type).
    Where HelloExample is the class name.
    Main is the method entered with its argument types.
    In some cases I have the o/p as
    -- VM Started --
    ====== main ======
    main -- HelloExample
    callerMethod -- HelloExample
    ====== main end ======
    -- The application exited --
    By using Log4J is there any possibility of getting these sort of o/p along with the loggers supported by Log4J. i mean to say can i built an java application which supports the MethodEntryEvent and MethodExitEvent from java API and also uses the Log4J debugging. I took an e.g. trace example, which (in J2SE 1.4.x or 5.x) will be found in $JAVA_HOME/demo/jpda/examples.jar and unpacking it by
    jar -xvf $JAVA_HOME/demo/jpda/examples.jar i found the com/sun/tools/example/trace/Trace.java and passed the class constructed with logger taken from Log4J. In this case the logging message is displayed on the console. As per the requirement i need to transfer the whole o/p to an output file along with Log4J logger statements. in this case i should not give any command in the cosule except compiling and executing the programme. the programm also should able to run without the main() as i need to integrate Log4J with an application and the code must me application server independent. i need the output as i got using MethodEnteryEvent (shown as above) in case of java application built using Log4J.
    Can any one help me in this regard. can any one give me some suggestion or any programme of this sort. All suggestions are welcomed.
    Thanks & Regards,

    hi,
    can someone help me how to implement logging for method entry parameters and
    method exit return value.
    can someone help me how to use log4j and integrate it to the method entry
    logging and method exit logging.
    Here what i need is without writing the log statements for the method entry and
    method exit i need to log it to the file
    along with other log4j debug statements i provide in the file.I should be able
    to configure whether to enable/disable the logging
    for method entry and method exit. In method entry i should be able to log the
    parameters the method take and in method exit
    i should be able to log te return value to the log file, before the method is
    returned to the callee.
    i hope i am clear
    Thanks in advance.

  • Can we run a java application using Runtime.exec()?

    Can we run a java application using Runtime.exec()?
    If yes what should i use "java" or "javaw", and which way?
    r.exec("java","xyz.class");

    The best way to run the java application would be to dynamiically load it within the same JVM. Look thru the class "ClassLoader" and the "Class", "Method" etc...clases.
    The problem with exec is that it starts another JVM and moreover you dont have the interface where you can throw the Output directly.(indirectly it can be done by openong InputStreams bala blah............). I found this convenient. I am attaching part of my code for easy refernce.
    HIH
    ClassLoader cl = null;
    Class c = null;
    Class cArr[] ;
    Method md = null;
    Object mArr[];
    cl = ClassLoader.getSystemClassLoader();
    try{
         c = cl.loadClass(progName.substring(0,progName.indexOf(".class")) );
    } catch(ClassNotFoundException e) {
    System.out.println(e);
         cArr = new Class[1] ;
         try{
         cArr[0] = Class.forName("java.lang.Object");
         } catch(ClassNotFoundException e) {
         System.out.println(e);
         mArr = new Object[1];
         try{
         md = c.getMethod("processPkt", cArr);
         } catch(NoSuchMethodException e) {
         System.out.println(e);
         } catch(SecurityException e) {
         System.out.println(e);
    try {            
    processedPkt = md.invoke( null, mArr) ;
    } catch(IllegalAccessException e) {
              System.out.println(e);
    } catch(IllegalArgumentException e) {
              System.out.println(e);
    }catch(InvocationTargetException e) {
              System.out.println(e);
    }catch(NullPointerException e) {
              System.out.println(e);
    }catch(ExceptionInInitializerError e) {
              System.out.println(e);
    }

  • How can i get a java application

    how can i get a java application on my mac pro?

    I'm not sure I understand the question. If the application is a standalone applet, you download it as you would any other application or file. If the applet is embedded in a web site, just go to the appropriate web page.
    If you can provide more specifics about what it is you are trying to download/accomplish, perhaps we can be of more specific assistance.
    Regards.

  • How can I debug webdynpro java application?

    hi,
    How can I debug webdynpro java application?
    Thanks

    Check this document
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d0cb32c5-36a7-2910-2c9b-ba4a5bbdbb56
    Also check this sdn thread Re: DeBugginng The WebDynPro Application particularly shailesh kumar posting
    /padmanaban
    Edited by: Padmanaban on Sep 26, 2008 1:55 AM

  • How can i let my java application closes the other opened windows

    how can i let my java application closes the other opened windows: like any other Microsoft Internet Explorer windows ... provided that my java application is not the one i used to open those other windows.... thanks in advance

    you'll have to use JNI to access the windowAPI
    then you need a list of window handles ... I think there was a function called getWindow and in order to close them you use sendMessage .... for details check out msdn (microsoft developer network)
    somwhere I saw a tool called JUtil, which might help you getting started on accessing the win api from java
    regards
    Spieler

  • How can I interface a Java application which is not running under NetDynamics, to use the EJBs in a NetDynamics application?

    One of them uses Enterprise Java Beans implemented with a SUN NetDynamics application server. The other is a straight Java application. Ideally I want the second application to remotely invoke methods on the existing Java beans, so the existing business logic will not be duplicated.
    This would seem to be simple, but NetDynamics appears to substitute some proprietary code for part of the EJB interface, and it is not immediately obvious how to let "foreign" java programs access the beans.
    I would appreciate it if anyone is able to provide any information on how to achieve this. If you know of any sample code that I could look at, that would be a help too. This may (or may not) be known to SUN as a "stand alone java client".

    hi,
    can someone help me how to implement logging for method entry parameters and
    method exit return value.
    can someone help me how to use log4j and integrate it to the method entry
    logging and method exit logging.
    Here what i need is without writing the log statements for the method entry and
    method exit i need to log it to the file
    along with other log4j debug statements i provide in the file.I should be able
    to configure whether to enable/disable the logging
    for method entry and method exit. In method entry i should be able to log the
    parameters the method take and in method exit
    i should be able to log te return value to the log file, before the method is
    returned to the callee.
    i hope i am clear
    Thanks in advance.

  • How can i launch another java application using Runtime class?

    I created a java process which invokes another java application called Launch as shown below,
    Process p=Runtime.getRuntime().exec("java -classpath=C:\\Program Files\\bin\\nettools\\ui\\updates Launch");
    But it is not working...can any one help me on this?
    Edited by: deepakchandaran on Sep 20, 2007 7:10 AM

    You could search the forum and Google.
    it has been answered before.
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • Can i develope a java application using C API

    hai,
    i have C api, the project was developed in C before, now i am having that api. I have to do that in java by using that C api.
    can any one suggest me how to do this?

    Your question is not that very clear!! You want to convert the C api to a Java api? or you want to develop a Java application that uses the C api?
    For the first question I believe that you should check the functionality of the C api and re-code it in Java! do not believe you should find anything imposible in that! (unless that api is trying to do something crzy directly with memory)
    For the second question then I believe you will have to use native calling or something like that. I have never used it, but read about it, and it seems one way how Java can interect with C.
    Over here there is a forum.
    Regards,
    Sim085

  • I can't find Cocoa-Java Application after Xcode Version 3.2.1 install..

    Can anyone tell me what happened to all the different Java Applications and Applet selections when File/New Project is selected from Xcode version 3.2.1 64bit? I can't seem to find it. Prior to installing this new version of Xcode, I had full access to all the different Java suites, now I have nothing. Please help, coding seems to compile, I just want to have the choices there for learning purposes. For example:
    Ant-based Application jar
    Java AWT Applet
    Java AWT Application
    Java Swing Applet
    etc.
    Any help would be greatly appreciated.
    I had just read in the Iphone Developer section that:
    +Important: You will need to re-install the iPhone SDK or Snow Leopard if you plan on developing iPhone applications after upgrading your Mac to Snow Leopard and installing Xcode 3.2.+
    Would somebody be able to give me installation instructions on installing the http://developer.apple.com/iphone/download.action?path=%2Fiphone%2Fiphonesdk_3.1.2__final%2Fiphone_sdk_3.1.2_with_xcode_3.2.1__snow_leopard_10m2003.dmg.. It looks like at this point I should have kept the previous version I was using and should have done a custom install. Am I allowed to create a folder called /Developer2 and put an older archived version of Xcode in there? Any help would be greatly appreciated.
    Best Regards,

    ...now I have nothing. Please help, coding seems to compile, I just want to have the choices there for learning purposes. For example:
    Ant-based Application jar
    Java AWT Applet
    Java AWT Application
    Java Swing Applet
    Changed - Apple has this to say about that:
    "The Java templates in the Organizer (Window > Organizer Cmd-Ctrl-O) are still present, however all but one of the Java project templates have been removed.
    The JNI project template is the only Java project template that remains, because it builds a native library. The template has also been re-written to be a full graphical Swing application that calls into the native Mac OS X address book. I'd highly encourage anyone who is interested in JNI development on the Mac to check it out.
    The only additional developer content we ship for Java is the source and javadoc for the JDK itself, and does not include any templates."
    -=-=-=-
    To create Java projects w/Xcode 3.2.1 as an example, you must first open Organizer by choosing Window > Organizer. At the bottom of the Organizer window, you will see three buttons.
    OrganizerBottomBar
    Click the + button on the left and choose New From Template > Java Templates to create a Java project. Click the right button at the bottom of the Organizer to show the editor. Use the editor to write your code.

  • Can I run existing web application on portal 4.0?

    Hi,
    I have existing web application running on tomcat server. Can I move it to portal
    server ? If yes, what do I need to do?
    Thanks in advance,
    Meghana

    You sure can. WLP4 requires WLS6.x (check the download site for correct
    version). You can deploy your web app using the WLS console.
    Subbu
    Meghana wrote:
    Hi,
    I have existing web application running on tomcat server. Can I move it to portal
    server ? If yes, what do I need to do?
    Thanks in advance,
    Meghana

  • Why can`t I install java applications on E50???

    When I try to install java applications on my E50, at the end of installation I receive the message "Unable to install"
    I think I don`t have java installed on my phone...how can I fix this? 10x

    The E50 has Java installed; a version of Java known as J2ME (Java 2 Micro Edition) a.k.a. MIDP/CLDC. Make sure you are trying to install Java apps made for J2ME (MIDP/CLDC), and not, e.g., J2SE (Java 2 Standard Edition) which is for PCs.
    Also, check this setting: menu > Tools > App.mgr > Options > Settings > Software installation > All

Maybe you are looking for

  • Problème acquisition sur PCI 6032E

    Bonjour, je suis actuellement en stage de fin d'étude et il m'ai demandé de réaliser l'aquisition d'un thermocouple. Nous pouvons utiliser qu'une carte PCI 6032E directement et le logiciel labview. Nous avons beaucoup de perturbation et nous ne compr

  • PL/SQL Using SQL%NOTFOUND to raise a user defined exception in a function

    I have written the following function for finding the number of items in stock in the item table. CREATE OR REPLACE function getAmount (ItemID IN NUMBER) RETURN NUMBER AS invalid_id EXCEPTION; returnedQty number; BEGIN Select qty Into returnedQty Fro

  • 'Natural' Track Or

    There are various earlier posts on this topic re other players and I wonder therefore whether it is a generic issue with all MP3 players, but just in case there is more recent knowledge, please bear with me if I am repeating what is obvious or alread

  • How to stop Firefox for Androids crashing on my Kindle Fire.

    Installed OK but when I open, opening page appears, lasts ~5 seconds, then disappears. How can I stop this?

  • Video stopps after a few seconds

    I have a problem playing longer videos on my ipod 60gb. If I load a short video, like 4 minutes, it will play until the end. But if I load a complete movie, like more than an hour, the video will stop after a few seconds. After a short break it conti