Presentation is loading. Please wait.

Presentation is loading. Please wait.

19 - WebServices. 2 NOEA2009Java-kursus – Web Services Webservices in Java Web Service client Selected and edited slides from Siva Jagadeesan The original.

Similar presentations


Presentation on theme: "19 - WebServices. 2 NOEA2009Java-kursus – Web Services Webservices in Java Web Service client Selected and edited slides from Siva Jagadeesan The original."— Presentation transcript:

1 19 - WebServices

2 2 NOEA2009Java-kursus – Web Services Webservices in Java Web Service client Selected and edited slides from Siva Jagadeesan The original version is here: Intro to Web Services and Apache AxisIntro to Web Services and Apache Axis

3 3 NOEA2009Java-kursus – Web Services Outline Web Services Basics –What is Web Service? –Web Services Architecture –XML Messaging XML-RPC SOAP –What is WSDL? –Development plan for Service Requestor –Development plan for Service Provider

4 4 NOEA2009Java-kursus – Web Services Outline Intro to Apache Axis –What is Apache Axis? –Architecture of Apache Axis –Features of Apache Axis –Installing Apache Axis –Publishing Web Service through Apache Axis –Walkthrough of deploying and accessing a simple web service using Apache Axis

5 5 NOEA2009Java-kursus – Web Services What is Web Service? A Web Service is any service that – is available over the web – uses standardized XML messaging – is OS and Programming language independent

6 6 NOEA2009Java-kursus – Web Services XML Messaging There are two ways of XML Messaging XML-RPC SOAP

7 7 NOEA2009Java-kursus – Web Services What is XML-RPC ? is a simple protocol that uses XML messages to perform RPC Request are encoded in XML and send via HTTP Response are encoded in XML and received via HTTP is a easiest way to get started with web services

8 8 NOEA2009Java-kursus – Web Services Sample XML-RPC Request com.agram.sayHello Java

9 9 NOEA2009Java-kursus – Web Services Sample XML-RPC Response Hello Java

10 10 NOEA2009Java-kursus – Web Services What is SOAP? Simple Object Access Protocol SOAP is slightly more complicated than the XML-RPC SOAP extended XML-RPC It uses XML namespaces and XML Schemas.

11 11 NOEA2009Java-kursus – Web Services SOAP Message Envelope is like a wrapper for content Header is a optional element that could contain control information Body element includes requests and responses Body element will include a Fault element in the event of an error SOAP Message Envelope Header Body

12 12 NOEA2009Java-kursus – Web Services Sample SOAP Request <SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <ns1:sayHello xmlns:ns1="http://agram.com/"> Java

13 13 NOEA2009Java-kursus – Web Services Sample SOAP Response <SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <ns1:sayHelloReponse xmlns:ns1="http://agram.com/"> Hello Java

14 14 NOEA2009Java-kursus – Web Services What is WSDL? Web Services Description Language Has 6 major elements 1.definitions – defines the name of the web service 2.types – describes all the data types that will be transmitted 3.message – defines the name of the message that will be transmitted 4.portType – defines the operations 5.binding – defines how the message will be transmitted 6.service – defines where the service is located

15 15 NOEA2009Java-kursus – Web Services Development plan for Service Requestor 1) Find the web service (Google, Xmethods.net etc.) 2) Retrieve service description file 3) Create XML-RPC or SOAP client 4) Invoke remote service

16 16 NOEA2009Java-kursus – Web Services Development plan for Service Provider 5) Register new service via UDDI 1) Create the core functionality 2) Create XML-RPC or SOAP service wrapper 3) Create service description file 4) Deploy service

17 17 NOEA2009Java-kursus – Web Services Make a WebService with NetBeans First install NetBeans EE bundle 5.0 or later Can be downloaded from www.netbeans.orgwww.netbeans.org To make a WebService in NetBeans is nearly as easy as in VisualStudio....

18 18 NOEA2009Java-kursus – Web Services Live Demo Da NetBeans laver om for hver ny version er det bedre med en tutorial fra dem, end screendumps på slides. Tutorial for 6+ er her: http://netbeans.org/kb/60/websvc/jax-ws.html http://netbeans.org/kb/60/websvc/jax-ws.html

19 19 NOEA2009Java-kursus – Web Services Exercise 1.Make a web service client in Java. Use an appropriate Web Service, ie. a weather service F.eks iistest.noea.dk/weather 2.Make a simple webservice in Java. Use NetBeans, Eclipse or Axis


Download ppt "19 - WebServices. 2 NOEA2009Java-kursus – Web Services Webservices in Java Web Service client Selected and edited slides from Siva Jagadeesan The original."

Similar presentations


Ads by Google