Java web services basic question

Hi all,
I'm new to web services programming, and I'm having trouble getting my head around a few conceptual ideas about web services. I'm in a graduate class right now where our project needs to use web services to create a distributed system. We're using Axis2 and jUDDI for development.
In terms of distributed systems, I am a CORBA programmer, and so when I'm given a problem, my mind immediately goes to how I would implement it in CORBA. Web services seem similar (the WSDL is like an IDL, an jUDDI is like the CORBA naming service, etc) but I'm having difficulty figuring out how to instantiate two (or more) web services that implement the same interface.
From the simple 'hello, world' web services I've done, I have created a java class, compiled it, packaged it into a .aar, and deployed tye aar using Axis2 on Tomcat, my application server (which somehow creates the WSDL file - I'm not exactly sure how that happens either). From there, it's simple to write a client to connect to the web service, which seems to always be running in the application server.
Now, for the system I'm working on, we need to have multiple 'instances' of a service. For example (note this isn't the actual project assignment), say there is a 'GPS_Service' web service with a simple interface with two methods: getLocation(), and setLocation(point p). In my 'application', I want to deploy 15 'instances' of GPS_Service, and set and view their location independently.
Here's where my lack of knowledge hurts. From my point of view, I would need 15 different java classes (i.e. GPS_Service0, GPS_Service1, etc) and 15 different .aar files. Each .aar file would go into the application server, and I would access each service at a different web address.
In CORBA, this is much easier. Classes implement a CORBA interface, and your 'main' method can instantiate as many 'GPS_Service' objects as it wants. This seems to be because CORBA doesn't have an 'application' server where the object is always running.
Does anyone have any suggestions for me, or does anyone have an example of what I'm trying to do?
Thanks,
Eric

I forgot to answer your question.
You have to consume the webservice :
http://gerardnico.com/wiki/ide/eclipse/eclipse_how_to_consume_a_webservice_with_wtp
It will create for you the package
com.siebel.analytics.web.soap.v5
See my example. I think it's enough complete.
Success
Nico

Similar Messages

  • Need an intro to java web services basics

    Do you have any link that would be good for the basics in java web services?
    Thanks ... J

    HTH
    http://java.sun.com/webservices/docs/1.1/tutorial/doc/

  • Java Web Services Newbie Questions

    I have some questions concerning developing Web Services in java. I understand the basic technology and concepts, but am not familiar with the available Java pieces to accomplish what I need to.
    1. What application do I need to service a Web Service? I would prefer to run apache (running on an AS/400). Can apache do this? What in addition to apache (plug-in?) do I need to service the Web Service?
    2. What application (plug-in?) do I need to provide the UDDI lookup for my Web Services? Again, I would prefer to do this in apache. Do I need a plug-in, etc.
    3. Is there an IDE or package that will make creating the Web Service easier. I am currently using Eclipse for some other java work, so it would be nice if this IDE would work well for this. I am hoping for some plug-in that will make it easy for me to provide a method prototype, and the WSDL and perhaps client proxy classes get generated from this?
    4. How should I create my WSDL? (this may be answered by the previous question)
    5. How should I create the client proxy classes? (this may be answered by the previous question)
    6. Anything else (tools, API's, plug-ins) I need to know how to make this happen quickly. I need to implement a couple web services in just a few weeks.
    Thanks.

    1. There are 3 ways i can think of:
    a. J2EE 1.4 App Server (e.g., 1.4 Beta 2 from Sun)
    b. JWSDP
    c. 1.3 IDE with Web Services support (WebShere, Sun One...)
    2. You need to register with a public registry, such as those by IBM, Microsoft, etc.
    3. Partly answered in 1... I prefer working with 1.4, because that is a new standard coming up, so no serious changes will be needed later.
    WSDL and stubs/ties are generated for you by tools like wscompile, but you do have to code the client itself :)
    4. wscompile, etc. can be invoked by tools like ant based on your build file, or by IDE.
    5. Automatically done...
    6. I think i covered the tools above. For the rest, I'd recommend going through J2EE 1.4 Tutorial, or cases like those provided by some IDEs.
    HTH,
    Reshat.

  • Web service basic question

    Well I am new to web services. I have a small doubt. We are trying to develop a tool which uses web service that standards the communication between my tool and different surveillance
    systems.
    What my tools should do is, it needs to get data from different surveillance
    system using common API.
    My first question is
    1) Should I implement a web service or a client. I guess the answer should be, implement a client. if so, should I make my WSDL public and tell them and if you want to provide me the data you have implement a web service definition corresponding to my client. I am a bit confused here. So pleeeeeeeease help. I need to submit my design to my professor by the end of the week.

    If your tool needs to be called from the surveillance systems, you could publish a web service and give the wsdl to the various surveilance systems. Then when they need to contact you they can invoke your web service.

  • Newbie question to java web services....

    hi,
    I used to be a .net programmer for a few years, and am have done web services in .net.... (using IIS, of course)
    And i moved onto Java side recently - and am pretty new to tomcat / axis..etc..
    I looked at the netbeans ide tutorial, and it covered on how to create a web services and a client using the IDE - with that is with the sun app server. Since I want to stick with Tomcat (which is a servlet container, i believe), the compilation complained that the HelloWSImpl.java is not a servlet, and will not let me run the web app. I have tried the WSDP 2.0 tutorial as well, but I first got the FastSetsource.jar not found? Then I got some other classes not found..etc... so, until now - i still am not able to create a web service, and a cliet to talk back and forth.
    I have the following questions..
    1. I am confused that how come tomcat itself is already a webserver, why would people use it on top of apache http server, which is another web server?
    2. To create a web services, (I am thinking of the .net web services that i have done - that once you deploy it with IIS, and you browse to that service, if the function takes 2 parameter, there will be 2 textboxes waiting for you to put data to, then once you post - the xml response will come back...), does java allow front end interface automatically like that in .net? Or you have to code the JSP pages to include those textboxes yourself, and do a manual post to the web services address?
    3. Are there any book out there, explains how to use tomcat for webservices? I have looked thru some of the java books that talks about web services, they mainly explain what webservices are, what is xml..etc... and of course, they did talk about the differenct type of messaging format available. (JAX-RPC..etc..)
    4. In the java world - how do you use webservices? Is it the same way that i am familiar with? Like, that we have a front end gui, that it will call the web services, pass it a few param, and get the xml result back, and parse it and display / store.. it? Or that is not the correct way to consume the web services in java world?
    5. In .net - as long as i have the .net framework sdk, and a IIS - i am good to go. In java - what do i need in order to deploy a web services?? I already have tomcat / jdk / wsdp / IDE - do i have enough to create a simple ws? if so, can you show me a basic tutorial??
    based on some reading, i understand that the ws on the service side, needs an SEI implementing java.rmi.remote, and we need another class implementing this SEI. But I would really want to see more example, or downloads, where i can just download / view the whole thing all at once... I googled "java web service", "jax-rpc example"..etc.. most of the return links are from either java.sun.com, or ibm, or some other vendor's web site, explaining the architecture... I really want to look at the code, to get a better understand, what is the relationship between each of these softwares (tomcat, apache http server, axis...)
    Any suggestions??
    Thanks,
    T

    I think I can answer your Q1
    Apache is very good at serving simple HTML pages
    Tomcat is capable of serving active content
    So the two complement each other
    Or that's how I understand it.
    Steaker

  • JDeveloper 10g 10.1.3 Web Service Question: java web service calls another

    I am looking for what I think should be a simple example/tutorial but so far no luck. I am using JDeveloper 10g 10.1.3 and the Oracle Application Server.
    I want to do this:
    - create a simple Java web service
    - deploy it
    - create another simple Java web service, that makes a call to a method on the first service
    - deploy it
    client->WSfront->WSback
    I want to keep this as basic as possible.
    Although I have found examples of how to create a web service proxy, there are no examples that I have found that show how to use that proxy in another web service:
    I did what I thought were the right things; generated a proxy for the first web service, and used that proxy in the second web service's source Java class. However when I deployed and tested many classes were missing: all the classes the proxy class depends on.
    I actually managed to get something like this working but had to manually create the .ear and .war files for WSfront, explode the archives, and manually add the missing classes to its WEB-INF/classes.
    I am comparing this to things like Weblogic Workshop in which doing this exercise is a snap.
    Is there a simple graphical way to do this in JDeveloper?

    Hello again,
    I am quite surprised I got no responses to my query below.
    Can anyone explain how I might do this?
    Please feel free to respond to [email protected]
    I am looking for what I think should be a simple
    example/tutorial but so far no luck. I am using
    JDeveloper 10g 10.1.3 and the Oracle Application
    Server.
    want to do this:
    create a simple Java web service
    deploy it
    create another simple Java web service, that makes a
    call to a method on the first service
    deploy it
    client->WSfront->WSback
    want to keep this as basic as possible.
    lthough I have found examples of how to create a web
    service proxy, there are no examples that I have
    found that show how to use that proxy in another web
    service:
    I did what I thought were the right things; generated
    a proxy for the first web service, and used that
    proxy in the second web service's source Java class.
    However when I deployed and tested many classes were
    missing: all the classes the proxy class depends
    on.
    I actually managed to get something like this working
    but had to manually create the .ear and .war files
    for WSfront, explode the archives, and manually add
    the missing classes to its WEB-INF/classes.

  • Java web service question

    I am trying to create a java web service using the wizard in Jdeveloper, but I am not able to pick up the java class I want. I already setup the classpath and library to include the java class files. but seems the wizard doesn't look at the classpath. what's the right way to do it?
    Is there any demo or tutorial code about how to create java web service ?

    Hello again,
    I am quite surprised I got no responses to my query below.
    Can anyone explain how I might do this?
    Please feel free to respond to [email protected]
    I am looking for what I think should be a simple
    example/tutorial but so far no luck. I am using
    JDeveloper 10g 10.1.3 and the Oracle Application
    Server.
    want to do this:
    create a simple Java web service
    deploy it
    create another simple Java web service, that makes a
    call to a method on the first service
    deploy it
    client->WSfront->WSback
    want to keep this as basic as possible.
    lthough I have found examples of how to create a web
    service proxy, there are no examples that I have
    found that show how to use that proxy in another web
    service:
    I did what I thought were the right things; generated
    a proxy for the first web service, and used that
    proxy in the second web service's source Java class.
    However when I deployed and tested many classes were
    missing: all the classes the proxy class depends
    on.
    I actually managed to get something like this working
    but had to manually create the .ear and .war files
    for WSfront, explode the archives, and manually add
    the missing classes to its WEB-INF/classes.

  • How to test a Java Web Service locally?

    I developed simple java web services.
    Now I want to test them locally.
    I want to expose my web service through my Web Server(Tomcat).
    How can I expose that webservice?
    After that I want to access my web service through a Internet Browser.
    Is it possible to test that web service locally (localhost)?
    My computer is not connected to a network or internet.
    My OS is Windows XP Professional.

    I just set up TCPMON. Considering it is free and the fact that it has more than just a basic UI, I am quite impressed. I also use SOAPscope, which is another great tool, but I am looking for a free option.
    My issue: I set up TCPMON to sniff messages sent over HTTPS through port 8080. But I am getting encrypted messages upon sending the SOAP request as follows:
    �b�b�b�bvC�Ym�)f��OvC�Ym�)f��W�O�k�v�W��dQ�$�{� �4�����F�������vO���XEC
    )��~9gl^�OvC�Ym�)f��W�O�k�v�W��dQ�$�{� �4�����F�������vO���XEC
    )��~9gl^�OvC�Ym�)f��W�O�k�v�W��dQ�$�{� �4�����F�������vO���XEC
    )��~9gl^�
    Any clue why?
    Your help is greatly appreciated.
    Aish

  • Generation Error - when trying to publish a Java web service

    Hi All,
    I keep getting the following Generation Error -- java.util.NoSuchElementException_ when I'm trying to create a Java Web Service using the jdeveloper wizard.
    I have 2 entities and 2 stateless session beans acting as their facades. One entity has a One-One(FK) relationship with the other entity. I test out the entities and session beans using the test client and the OC4J embedded container and everything seems to work. When I try to generate a Java WebService from one of the entities I keep getting the "Generation Error". Could someone please provide me with some insight into why I'm facing this problem, because it seemed fine when I published J2EE web services previously and now this happens and I cant seem to publish web services anymore. Everytime I keep getting the same GenerationError. Thanks in advance.

    Without going into any technical discussion about the code, my first question is what JDK version was used to create this which was imported into the form? Understand that Forms 10 runs on JDK 1.4.2, so if you used any newer JDK version, likely there will be problems.

  • Java web services tutorial.

    Hi i have seen and tried the Java web services JAX-RPC tutorial.
    And i have a question here.
    If i want to invoke lets say a web service on a .NET platform, can i still use JAX-RPC to invoke it?
    Must the server implement JAX-RPC if i want to use it on the client side?
    sorry i still not clear about it.

    once you are done creating .war files having WSDL and all, deploy it on Tomcat or any other web container.
    create .vb (or which ever language) stub for the JAX-RPC service using WSDL.exe for the .NET enviornment.
    In your .NET enviornment, import this stub in your project. In your code, you can define a local varible as a "JavaService" object and assign the instance of your jax-rpc service and use the local variable methods as any other object method calls.

  • Java Web Services Developer Pack 1.3 now available

    All,
    The Java Web Services Developer Pack 1.3 is now available for
    download from http://java.sun.com/webservices. This release of JWSDP includes the fcs release of JAXRPC 1.1 and SAAJ 1.2 based on the WS-I basic profile 1.0 in addition to bug fixes /maintenance relases of the other components that have been in there in the previous releases. Feel free to download and send us comments at [email protected]
    - Rajiv
    :wq

    I was pumped when I saw this post, then deflated when I read what was new...
    No new JSF. I'm sooo ready for an update :-)
    TTFN,
    -bd-
    http://bill.dudney.net/roller/page/bill

  • "The Java Web Services" - ant install

    Hi, I recently downloaded "The Java Web Services" and "The Java Web Services Tutorial".
    And I've reached the Creating the Build Properties File portion of the tutorial:
    http://java.sun.com/webservices/docs/1.0/tutorial/doc/GettingStarted2.html#73059
    I'm using Windows ME and I have no idea where to put the build.properties file.
    Can anyone give me any suggestions? I am successfully able to
    ant compile
    but I can't get
    ant install
    to work once I have done the ant compile and I suspect this is because of me not having the build.properties file set... although it could be unrelated to that.
    when I try to use:
    ant install
    I get the following error at the command prompt:
    C:\tim\programs\jwsdp-1_0\docs\tutorial\examples\gs\build.xml:46: java.io.IOExce
    ption: Server returned HTTP response code: 401 for URL: http://localhost:8080/ma
    nager/install?path=%2Fgs&war=file%3AC%3A%5Ctim%5Cprograms%5Cjwsdp-1_0%2Fdocs%2Ft
    utorial%2Fexamples%2Fgs%2Fbuild
    Now tomcat is running on the correct port (8080) and the directory being referenced in the above URL exists. Am I supposed to map tomcat to a particular file system or something?
    Thanks,
    Tim
    PS I have another post in this forum (it contains only my first question concerning the build.properties file), so if you would like the Duke dollars for both posts, feel free to post in both threads and if your answer helps me out, I'll give you the Dollars from both threads.

    Hi Tim
    I have the same problem with the build.properties file. i am not able to solve the problem. did u find any solution for that problem u had. so plz let me knpow about that. i would appreciate if u could mail mne at [email protected]
    thanks in ADV.

  • "java Web Service from WSDL" just hands me a SOAPElement, no java mappings

    Another beginner question. I've used jdev and built a WSDL starting from a somewhat complex xsd. I've used the wizard "Java Web Service From WSDL" taking defaults. It seems to correctly generate class files for all my xsd types. It produces a fancy looking java-wsdl-mapping.xml But the generated stub service implementation just gets handed a SOAPElement object. Why generate all that mapping stuff and then make me parse the incoming data myself with SOAPElement methods? How am I supposed to make use of the mapping work that the wizard seems to have done for me?
    Thanks,
    Steve

    Dear Tugdual,
    Thanks for your intrest in my issue. I narrowed it down to the following type in my xsd
    <complexType name="PersonInfoType">
    <sequence >
    <element name="FamilyName" type="string"/>
    <element name="IndividualName" type="string"/>
    <element name="SpouseName" type="string"/>
    <element name="BirthDate" type="dateTime"/>
    </sequence>
    </complexType>
    This works fine - the "WebSerice From WSDL" wizard "knows" how to generate a class for PersonInfoType (with geters and seters) as well as useful stub implementation:
    public class PersonInfoImpl {
    public PersonInfoType processPersonInfo(String entityCode) {
    return null;
    However, if I make my type multiple occuring (to represnt e.g. rows from a db)
    <complexType name="PersonInfoType">
    <sequence maxOccurs="unbounded" >
    <element name="FamilyName" type="string"/>
    <element name="IndividualName" type="string"/>
    <element name="SpouseName" type="string"/>
    <element name="BirthDate" type="dateTime"/>
    </sequence>
    </complexType>
    Now the Web Service generator runs, but just doesn't generate any PersonInfoType class at all. For a stub implementation it genertes the following:
    public class PersonInfoImpl {
    public SOAPElement processPersonInfo(String entityCode) {
    return null;
    Now I'm stuck with the container just expecting from me a Soap Object and I have to build all the pieces myself with no java mappings to my xsd at all. Not very useful.
    Is there another xml structure I can use to represent data rows that is better supported by the wizard?
    Thanks,
    Steve

  • Java Web Service / ABAP Client proxy ... username & password

    I have some ABAP function modules that need to use some Java web services. For this, I have created a client proxy that is utilized by the ABAP function module and the client proxy in turn communicates with the Java web service.
    The web service does BASIC (USERNAME/PASSWORD) HTTP AUTHENTICATION. When I execute the ABAP function module in test mode, I am prompted with a username/password. How can I pass this username and password to the Java web service programmatically.

    Hi
    See this Help
    http://help.sap.com/saphelp_nw2004s/helpdata/en/6a/14e13d8ee4535ee10000000a114084/frameset.htm
    Kind Regards
    Mukesh

  • How consume java web services

    Hello,
    I want to use java webservices.
    I read WSDL file but i don't know how to implement and to use method of this service.
    Can you help me ?
    Thanks
    Moderator Message: Frequently Asked Question. Please search for available information before posting.
    Edited by: kishan P on Dec 6, 2010 2:20 PM

    From your post it is not clear what kind of Java web service client (JAX-WS, JAX-RPC, Axis) you are using. The problem being faced is also not clear in the post. Some more elaboration may help others in providing inputs.

Maybe you are looking for

  • Annoying forum messages

    Dear all, I am not sure how many times you might have been told that "We are sorry but your message can not be posted since you have used forbidden words/phrases. Please edit your post according to the forum guidelines and re-post." I cannot believe

  • HP ProBook 4525s can't restore or repair HELP

    I know I should have the disk handy, but can't locate install disk or recovery disk.  Is there a way to do a factory reset with them??  I tried to execute the factory reset function, but it is askling for disks.  Argh...sorry. frustrated  I was unins

  • Concatanation of values in ITS Template

    Hi, I have an requirement where I want to capture all the data of internal table in single field.I am getting all the fields of table in ITS template but unable to concate them in single field .I am using SRM 5.0 and using following code . <input typ

  • Disk space configuration

    Hi, Platform - Oracle 11gr2 OS - RHEL 6. IBM Blade Server. The blade server comes with default storage of 140G having RAID 1. We installed the OS Binaries. Around 80 G left. 1> Is it a good idea to use up the space to put the Oracle binaries and crea

  • Nested Classes & Acessibility

    I have a class A, which can contain multiple instances of B. Class A Class B HashMap MapofSomeIdAndObjectsOfB; My Query is:- Class C Can I take reference of Class B here (which is a nested class in class A)...If yes, how? }