Presentation is loading. Please wait.

Presentation is loading. Please wait.

EuroFIR Web Services General introduction to Web services and an implementation example Karl Presser.

Similar presentations


Presentation on theme: "EuroFIR Web Services General introduction to Web services and an implementation example Karl Presser."— Presentation transcript:

1 EuroFIR Web Services General introduction to Web services and an implementation example Karl Presser

2 Agenda 1.History and background of Web services 2.WS Components SOAP WSDL UDDI 3.REST and Mashups 4.An example using Apache AXIS

3 History and Background The original purpose of HTTP was to provide a way to publish and retrieve hypertext pages over the internet BrowserWeb Server Middleware Application server DB user program

4 History and Background Business to Business Web Server Middleware Application server DB User program Web Server Middleware Application server DB User program Internet Firewall Remote Procedure Call (RPC), CORBA or DCOM Client stub Server stub directory Not local Already implemented Only port 80 Already implemented Security

5 History and Background The idea of Web Services use existing software systems use port 80/25 to get through all firewalls use a standard representation schema, e.g. xml make it platform independent make it programming language neutral construct it modularly for reuse make it secure, reliable, transactional and … Client Server Stub Wrapping system internet

6 Service requester WS Components SOAP (simple object access protocol) as transport protocol WSDL (web service description language) UDDI (universal description and discovery protocol) Service registry Service provider bind find publish Service description Service interface Service Service description

7 SOAP Client call Stub, runtime service location SOAP system Serialized XML Doc Wrap doc in HTTP Post request HTTP support (web client) SOAP as RPC mechanism Server do() Stub, runtime adapters SOAP system Serialized XML Doc Wrap doc in HTTP Post request HTTP support (web client) INTERNET

8 SOAP SOAP is … a message construct: A message format for communication using XML a processing model: Rules for SOAP message a extensibility model: How to extend basic massages with specific information a protocol binding framework: Allow different protocols like HTTP or SMTP a convention on how to turn a RPC all into a SOAP message und vise versa Language independent Envelope Header Body Header block Header Block Body element

9 WSDL Describes the interface of a Web service using XML schema The types used in the service model The messages for communication The operations The mapping to transport protocols The location of the service provider … …/> >endpoint adress= “…”…/>

10 UDDI Originally, UDDI was build as an “Universal Business Registry” similar to a search engine like Google. It contains business information like the name of the company business service offered by the company bindingTemplate which are technical information of the service tModel which can be used for additional information e.g. conditions for using the Web service

11 WS Standards and Spec

12 REST and Mashups REST is a collection of network architecture principles. It is used to describe interfaces which transmit domain-specific data over HTTP without further detail about the messaging layer Application state and functionality are provided using resources Every resource is uniquely addressable REST is stateless -> no need to store information For processes where a lot of context information is needed, the REST-url is getting longer and longer Procedures: getUser() addUser() removeUser() updateUser() REST examples: userResource = new Resource('http://example.com/user s/karl') userResource.delete()

13 REST and Mashups A Mashups is web application that combines data from more than one source into a new web service. An example is the Chicago Police Department which has a Mashup that integrates their department’s database of reported crimes with Google Maps.

14 Apache Axis Apache Axis is an implementation of the SOAP submission to W3C. It is a Java library that helps you to implement all tasks around SOAP and the installation on Apache AXIS is quite simple. The following example shows simplified the steps that are needed: 1. Take a java class (food_apple) and write your methods: public String food() { String s = “apple”; return s; } public long time() { return System.currentTimeMillis(); }

15 Apache Axis 2. Generate the WSDL file using Java2WSDL : javac food_apple java org.apache.axis.wsdl.Java2WSDL –o food_apple.wsdl … food_apple 3. Generate the stub files using WSDL2Java: java org.apache.axis.wsdl.WSDL2Java … food_apple.wsdl As a result you find food_appleService.java, food_appleSoapBindingSkeleton.java, food_appleBindingImpl.java, food_apple.wsdd and food_apple.java which are used on the server side. food_appleServiceLocator.java, food_appleSoapBindingStub.java and food_apple.java which are used on the client side.

16 Apache Axis 4. Copy your method from step 1 into the file food_appleSoapBindingImpl.java 5. Compile all files javac *.java 6. Deploy the web service using AXIS AdminClient java org.apache.axis.client.AdminClient … deploy.wsdd 7. Write the client using food_appleServiceLocator l= new food_appleServiceLocator(); food_appleSoapBindingStub stub = l.getfood_apple(): System.out.println(stub.food()); System.out.println(stub.time());

17 Thanks for your attention


Download ppt "EuroFIR Web Services General introduction to Web services and an implementation example Karl Presser."

Similar presentations


Ads by Google