Java Web Services Using Java in Service-Oriented Architectures By  Oğuzhan ACARGİL http://0guzhan.blogspot.com
Developing Web Services at a Glance <ul><li>Core Web Services:  JAX-WS, JAXB </li></ul><ul><li>Enhanced Web Services:  WSI...
Java api for XML Web Services   ( JAX-WS ) <ul><li>Between web services and clients with using XML </li></ul><ul><li>Messa...
http://0guzhan.blogspot.com
JAX-WS... <ul><li>Developing web services on server side with using java api </li></ul><ul><ul><li>Define methods in an in...
JAX-WS Implementation <ul><li>package helloservice.endpoint; </li></ul><ul><li>import javax.jws.WebService; </li></ul><ul>...
JAX-WS ... <ul><li>Developing web services on client side with using java api </li></ul><ul><ul><li>Create an object repre...
<ul><li>import javax.xml.ws.WebServiceRef; </li></ul><ul><li>import helloservice.endpoint.HelloService; </li></ul><ul><li>...
Advantages of JAX-WS <ul><li>Generating and parsing XML problem solved </li></ul><ul><li>Converting API calls and response...
Java API for XML Binding (JAXB) <ul><li>Binding between XML schema and Java representations </li></ul><ul><li>Incorporate ...
Prerequisite for JAXB <ul><li>Unmarshalling </li></ul><ul><li>Converting XML data into JAXB-derived Java objects </li></ul...
JAXB Architecture Overview http://0guzhan.blogspot.com
<ul><li>Schema compiler : Binds a source schema to a set of schema-derived program elements. </li></ul><ul><li>Schema gene...
JAXB Binding Process <ul><li>Generate Classes: read schema and create JAXB mapped classes </li></ul><ul><li>Compile Classe...
<ul><li>Steps in the JAXB binding process visualization </li></ul>http://0guzhan.blogspot.com
SOAP Attachments API for JAVA  (SAAJ) <ul><li>Behind the JAX-WS handlers  </li></ul><ul><li>Directly  creating and populat...
Approach of SAAJ, Shortly <ul><li>Connection created </li></ul><ul><li>Invoke method with sending SOAP envelope </li></ul>...
XWS-Security <ul><li>An implementation the Web Services Security (WSS) specification developed by OASIS </li></ul><ul><li>...
WSIT: Tango Project <ul><li>Providing interoperability with Windows Communication Foundation(WCF), the Web services stack ...
http://0guzhan.blogspot.com
METRO  <ul><li>High-performance,  </li></ul><ul><li>Extensible,  </li></ul><ul><li>Easy-to-use web service stack.  </li></...
http://0guzhan.blogspot.com
<ul><li>HTTP transport  </li></ul><ul><li>MTOM and XOP  </li></ul><ul><li>SOAP/TCP  </li></ul>http://0guzhan.blogspot.com
<ul><li>Reliability recover from failures caused by messages transmission. </li></ul><ul><li>Recovery is handled by the un...
Metro enables transactional support for web services.  http://0guzhan.blogspot.com
implements the WS-Security specification  http://0guzhan.blogspot.com
J2EE Web Services vs .Net Web Services <ul><li>The performance of core SOAP-based web services is significant </li></ul><u...
http://0guzhan.blogspot.com
Upcoming SlideShare
Loading in …5
×

Java Web Services and Glassfish Metro 2009

1,264
-1

Published on

Java Web Service Technologies and Glassfish Metro @2009

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,264
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
76
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Generate Classes: read schema and create JAXB mapped classes Compile Classes: Create objects of all recently created JAXB mapped classes Unmarshal: Read document to JAXB objects Generate content tree Validation is optional since data cannot be meets the constraints of first schema Process content Marshal: Write to document
  • Java Web Services and Glassfish Metro 2009

    1. 1. Java Web Services Using Java in Service-Oriented Architectures By Oğuzhan ACARGİL http://0guzhan.blogspot.com
    2. 2. Developing Web Services at a Glance <ul><li>Core Web Services: JAX-WS, JAXB </li></ul><ul><li>Enhanced Web Services: WSIT </li></ul><ul><li>Secure Web Services: XWS-Security </li></ul><ul><li>Legacy Web Services: JAX-RPC </li></ul>http://0guzhan.blogspot.com
    3. 3. Java api for XML Web Services ( JAX-WS ) <ul><li>Between web services and clients with using XML </li></ul><ul><li>Message oriented and RPC oriented web services </li></ul><ul><li>Soap Messages (XML) over HTTP </li></ul><ul><li>Java EE api hiding complexitiy from the application developer </li></ul>http://0guzhan.blogspot.com
    4. 4. http://0guzhan.blogspot.com
    5. 5. JAX-WS... <ul><li>Developing web services on server side with using java api </li></ul><ul><ul><li>Define methods in an interface </li></ul></ul><ul><ul><li>Implement those methods </li></ul></ul><ul><ul><li>Add required annotations to classes and web service methods (@WebService & @WebMethod) </li></ul></ul>http://0guzhan.blogspot.com
    6. 6. JAX-WS Implementation <ul><li>package helloservice.endpoint; </li></ul><ul><li>import javax.jws.WebService; </li></ul><ul><li>@WebService </li></ul><ul><li>public class Hello { </li></ul><ul><li>private String message = new String(&quot;Hello, &quot;); </li></ul><ul><li>public void Hello() {} </li></ul><ul><ul><li>@WebMethod </li></ul></ul><ul><li>public String sayHello(String name) { </li></ul><ul><li>return message + name + &quot;.&quot;; </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>http://0guzhan.blogspot.com
    7. 7. JAX-WS ... <ul><li>Developing web services on client side with using java api </li></ul><ul><ul><li>Create an object representing the service </li></ul></ul><ul><ul><li>Then simply, invoke web service methods </li></ul></ul>http://0guzhan.blogspot.com
    8. 8. <ul><li>import javax.xml.ws.WebServiceRef; </li></ul><ul><li>import helloservice.endpoint.HelloService; </li></ul><ul><li>import helloservice.endpoint.Hello; </li></ul><ul><li>public class HelloClient { </li></ul><ul><li>@WebServiceRef(wsdlLocation=&quot;http://localhost:8080/helloservice/hello?wsdl&quot;) </li></ul><ul><li>static HelloService service; </li></ul><ul><ul><li>public void doTest(String pName) { </li></ul></ul><ul><ul><li>try { </li></ul></ul><ul><ul><li>System.out.println(&quot;Retrieving the port from the following service: &quot; + service); </li></ul></ul><ul><ul><li>Hello port = service.getHelloPort(); </li></ul></ul><ul><ul><li>System.out.println(&quot;Invoking the sayHello operation on the port.&quot;); </li></ul></ul><ul><ul><li>String name; </li></ul></ul><ul><ul><li>String response = port.sayHello(name); </li></ul></ul><ul><ul><li>System.out.println(response); </li></ul></ul><ul><ul><li>} catch(Exception e) </li></ul></ul><ul><ul><li>e.printStackTrace(); </li></ul></ul><ul><ul><li>} </li></ul></ul><ul><ul><li>public static void main(String[] args) { </li></ul></ul><ul><ul><li>HelloClient client = new HelloClient(); </li></ul></ul><ul><ul><li>client.doTest(“Misal...!”); </li></ul></ul><ul><ul><li>} </li></ul></ul><ul><li>} </li></ul>http://0guzhan.blogspot.com
    9. 9. Advantages of JAX-WS <ul><li>Generating and parsing XML problem solved </li></ul><ul><li>Converting API calls and responses from & to SOAP messages </li></ul><ul><li>Platform independence of JAVA </li></ul><ul><li>Non-restrictive to platforms </li></ul><ul><li>Flexibility </li></ul><ul><li>Supporting WS-I(Web Services Interoperability) Basic Profile Version 1.1 </li></ul>http://0guzhan.blogspot.com
    10. 10. Java API for XML Binding (JAXB) <ul><li>Binding between XML schema and Java representations </li></ul><ul><li>Incorporate XML data and process functions in Java applications </li></ul><ul><li>Unmarshalling(reading) XML instance documents to Java content trees </li></ul><ul><li>Marshalling(writing) Java content trees back into XML instance documents </li></ul><ul><li>Generating XML schema from Java objects </li></ul>http://0guzhan.blogspot.com
    11. 11. Prerequisite for JAXB <ul><li>Unmarshalling </li></ul><ul><li>Converting XML data into JAXB-derived Java objects </li></ul><ul><li>Marshalling </li></ul><ul><li>Converting a JAXB-derived Java objects tree to XMLdata </li></ul><ul><li>Validation </li></ul><ul><li>Checking XML documents content meets the constraints of schema </li></ul>http://0guzhan.blogspot.com
    12. 12. JAXB Architecture Overview http://0guzhan.blogspot.com
    13. 13. <ul><li>Schema compiler : Binds a source schema to a set of schema-derived program elements. </li></ul><ul><li>Schema generator :Maps a set of existing program elements to a derived schema. </li></ul><ul><li>Binding runtime framework : Provides unmarshalling (reading) and marshalling (writing) operations for accessing, manipulating, and validating XML content using either schema-derived or existing program elements. </li></ul>http://0guzhan.blogspot.com
    14. 14. JAXB Binding Process <ul><li>Generate Classes: read schema and create JAXB mapped classes </li></ul><ul><li>Compile Classes: Create objects of all recently created JAXB mapped classes </li></ul><ul><li>Unmarshal: Read document to JAXB objects </li></ul><ul><li>Generate content tree </li></ul><ul><li>Validation is optional since data cannot be meets the constraints of first schema </li></ul><ul><li>Process content </li></ul><ul><li>Marshal: Write to document </li></ul>http://0guzhan.blogspot.com
    15. 15. <ul><li>Steps in the JAXB binding process visualization </li></ul>http://0guzhan.blogspot.com
    16. 16. SOAP Attachments API for JAVA (SAAJ) <ul><li>Behind the JAX-WS handlers </li></ul><ul><li>Directly creating and populating a SOAP messages </li></ul><ul><li>Directly sending request-response messages </li></ul><ul><li>Conforms to SOAP 1.1 and 1.2 specifications and the SOAP with attachments specification. </li></ul>http://0guzhan.blogspot.com
    17. 17. Approach of SAAJ, Shortly <ul><li>Connection created </li></ul><ul><li>Invoke method with sending SOAP envelope </li></ul><ul><li>Retrieve response </li></ul>http://0guzhan.blogspot.com
    18. 18. XWS-Security <ul><li>An implementation the Web Services Security (WSS) specification developed by OASIS </li></ul><ul><li>WSS accomadate a wide variety of models and encryption technologies </li></ul><ul><li>Message level security </li></ul><ul><li>Secure JAX-RPC & stand-alone SAAJ applications with </li></ul><ul><ul><li>Signing some parts </li></ul></ul><ul><ul><li>Encrypting some parts </li></ul></ul><ul><ul><li>Sending username-password authentication info </li></ul></ul><ul><ul><li>Or some combination of these... </li></ul></ul>http://0guzhan.blogspot.com
    19. 19. WSIT: Tango Project <ul><li>Providing interoperability with Windows Communication Foundation(WCF), the Web services stack bundled with the .NET 3.0 platform. </li></ul><ul><li>Project Tango(WSIT) implements for </li></ul><ul><ul><li>Security </li></ul></ul><ul><ul><li>Reliability </li></ul></ul><ul><ul><li>Transactions </li></ul></ul><ul><ul><li>Using the protocols and mechanisms of WS-* specifications. </li></ul></ul>http://0guzhan.blogspot.com
    20. 20. http://0guzhan.blogspot.com
    21. 21. METRO <ul><li>High-performance, </li></ul><ul><li>Extensible, </li></ul><ul><li>Easy-to-use web service stack. </li></ul><ul><li>One-stop shop for all your web service needs, from the simplest hello world web service to reliable, secured, and transacted web service that involves .NET services. </li></ul>http://0guzhan.blogspot.com
    22. 22. http://0guzhan.blogspot.com
    23. 23. <ul><li>HTTP transport </li></ul><ul><li>MTOM and XOP </li></ul><ul><li>SOAP/TCP </li></ul>http://0guzhan.blogspot.com
    24. 24. <ul><li>Reliability recover from failures caused by messages transmission. </li></ul><ul><li>Recovery is handled by the underlying system without consumer </li></ul><ul><li>or provider application code. </li></ul>http://0guzhan.blogspot.com
    25. 25. Metro enables transactional support for web services. http://0guzhan.blogspot.com
    26. 26. implements the WS-Security specification http://0guzhan.blogspot.com
    27. 27. J2EE Web Services vs .Net Web Services <ul><li>The performance of core SOAP-based web services is significant </li></ul><ul><li>WSTest was used to compare the performance of the J2EE and Windows .NET platforms when performing basic web services. </li></ul><ul><li>In the basic web services call, echoVoid, and the most complex one, echoSynthetic, JAX-RPC performs nearly 3 times better than .NET . In the other cases, J2EE technology performs nearly twice as well as .NET. </li></ul><ul><li>Conclusion: J2EE platform is completely portable, developers can expect to see this top-of-the-line performance on the Linux and Solaris platforms as well. </li></ul>http://0guzhan.blogspot.com
    28. 28. http://0guzhan.blogspot.com
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×