Web Services

Background concepts related to Web Services

Read from the "Bible" Book (pages 645 - 663 ) and answer the following questions:
  1. Which other technologies allow several systems to interconnect? List them and also their disadvantages
  2. What is SOA? Which are its advantages?
  3. Explain the philosophy of a web service
  4. Can we use technologies different from J2EE? Give examples (you can use the web if you don't find it at the Book)
  5. Does it has sense to use web services inside an intranet?
  6. If you are a manager that has to run a project with these technologies. Would you be worried about its costs?
  7. Give the name of some vendors that support these standards
    IBM, Microsoft, BEA Systems, Oracle, etc. More than 600 members.
  8. How can new Web services be discovered? Is there a technology that help us to do it?
  9. Imagine an application that could use Web Services, different from the ones mentioned at the book.
  10. Prepare a question/answer from the book to ask your colleagues
Solution



Web Services Directory
Here you can find Web Services where connect your Clients. Samples:
weather information at  http://www.webservicex.com/globalweather.asmx?wsdl 



Practica curs AsbaPrin (teacher only)

Practical:
Create a Web service Server and its client for a Java application you already have or a simple one you might create quickly.
Agree with someone else in the classroom to test his/her Web Service. He will have to give you the IP of his computer.

Let's use Netbeans EE for this part of the course.
When it gives you the option Glassfish/Tomcat, get the default: Glassfish, a full application server.
 
Example:
Create a program to exchange between diferents degrees units (Celsius, Farenhait and Kelvin)  and expose it as a Web Service.

Show it to the teacher in your Computer. It does not need to be uploaded.

SOAP WEB SERVICES-------

1.- Web services as a Client:

video 1:





video 2: https://www.youtube.com/watch?v=C53G6R5EVys






Video 4: https://www.youtube.com/watch?v=KFlDdb65w3U




Creating a Web Service Client
wsimport code just in case


Program to browse web services:
soap ui: program to browse web services:
http://www.soapui.org/   (you have an open source version here)

Now, try to do the same as in the videos with any of the following web services found in the following webs:

Sample of webs to find web services :
TempConvert

Webs recommmended by Marc:
http://www.programmableweb.com/apitag/shipping?apicat=Shipping&protocol=SOAP&format=XML  LA HOSTIA!

The teacher has installed a Web Server Server with Neatbeans at the IP that follows. Create a Java program or better a Form+Servlet program to query two numbers and calculate their addition using the Web Service Calculator.

Try to access the teacher's web service server at:
http://192.168.2.58:8080/CalculatorApp/CalculatorWSService?wsdl 

Once you have finished, install in your own computer the Web Service Server and try it in local.
Calculator server code for Netbeans

Solution of Form + Servlet to access as a client:
Calculator client code for Netbeans


2.- Web services as a Server:

Some concepts to review:
  • Web servers: Example Apache or IIS (Microsoft's Internet Information Server). You can install them a module to have a php server, for example.
  • Application Server. Two kinds:
    • not complete Application Server. Example: Tomcat. You can use them for Servlets/JSPs.
    • complete Application Server. Example: Glassfish, JBoss, WebSphere, etc.They are full J2EE compliant and, besides to use them for Servlets/JSPs, you can use them to expose WebServices, EJBs, etc. 
      Review what is a Java Annotation
Watch the following video (7 from this series) to see how to create a simple Web Service Server in a simple Java application. If you want to know how to install the application server GlassFish, watch the videos 5 and 6. Another option is to install and use Netbeans (IDE) that comes with GlassFish integrated in it.

Video 7: https://www.youtube.com/watch?v=u5cQkVgq6jE



Video 8: https://www.youtube.com/watch?v=HLzM92ZnisY




WS Samples:

Calculator server Netbeans
Calculator client Netbeans
WebServiceX It might not be available any more, but you can see the code

Web Services vs APIs:

An API (Application Programming Interface) is the means by which third parties can write code that interfaces with other code. 
A Web Service is a type of API, one that almost always operates over HTTP (though some, like SOAP, can use alternate transports, like SMTP).  Web Services don't necessarily use HTTP, but this is almost always the case and is usually assumed unless mentioned otherwise.
For an example of another type of API, one written in C for use on a local machine, see the Linux Kernel API.
more info


RESTful web services 
Watch the following video


Then answer THIS QUESTIONS





Comments