W Serv.

Let's use Netbeans EE for this part of the course. Download it here 
When it gives you the option Glassfish/Tomcat, get the default: Glassfish, a full application server.

My WSDL to test

Try to get a client for it. 
Hint: you neet to put a parameter with your name.

1.- Web services as a Client:

video 1:

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

If you want to see an introduction to RESTful web services, check this video.

Read from the "Bible" Book (pages 645 - 663 ) and answers 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

Basic steps to create Web Services with NetBeans

Video 3: https://www.youtube.com/watch?v=6hqDMS-oJ9k

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

Creating a Web Service Client
wsimport code just in case

Wsimport from a website. Usefull if your wsimport does not work (Jason??)

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:
used in class for the country of an IP: http://www.webservicex.net/geoipservice.asmx?WSDL

weather forecast:



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

Giging the WSDL

Create a program to check the weather in "Mahon", "Spain".

Check here the solution and information about the whole process

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: 

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 done:


Calculator server Netbeans
Calculator client Netbeans

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