VisualBuilder
  Home > Java > Tutorials > Enhancements for Web Services - Java 1.6 Tutorial
Tell a friend
Link to us
Total Members
      Members: 84772
     
Sitemap Forum Chat
Home
Java 1.6 Tutorial Home
1 . Collections Enhancements
2 . Console Class
3 . ArrayDeque Class
4 . ConcurrentSkipListMap Class
5 . ConcurrentSkipListSet Class
6 . HashSet Collection Framework
7 . Java.util
8 . File and Directory Permissions in JDK1.6
9 . Core Java Internationalization
10 . Enhanced memory leak analysis and detection
11 . Changes in NetworkInterface Class
12 . API Changes
13 .  Compression Using Java 6
14 . ZipOutputStream Class To Compress Files in Zip Format
15 . ZipInputStream Class To Decompress Zip files
16 . Enhancements for Web Services
17 . Steps to use the Scripting API
18 . Java Scripting API Introduction
 
 
Java Home
Java Members (27650)
Java Member Articles ( 40 )
Java Discussion (275)
Java Q & A ( 174 )
- Java Ask Question
- Java Questions
- Java Unanswered Questions
Java Resources
Java Source Code (1096)
Java Articles (551)
Java Blogs (118)
Java Jobs (797)
Java Components (85)
Java Books (169)
Java Websites (127)
Java News (103)
 
GROUPS
.NET
ASP.NET
.NET
C#
ASP
Visual Basic
Java
Java
JSP
EJB
Other
Delphi
C++
Ajax
UML
JavaScript
PHP
Web Design
Web Hosting
SQL Server
Oracle
Project Management
More Groups

 
LEARNING CENTER
TUTORIALS
.NET
.NET Tutorial
ASP Tutorial
ASP.NET Database Tutorial
ASP.Net Security,Internationalisation And Deployment
ASP.NET Tutorial
C# Tutorial
Web Development
Flex Tutorial
HTML Tutorial
Learn AJAX Tutorial
PHP Tutorial
Software Development
Database Tutorial
SQL Tutorial
UML Tutorial
Java
Ant Tutorial
EJB 3 Tutorial
Hibernate Tutorial
Java Tutorial
Java Web Component Tutorial
Java XML Tutorial
JDBC Tutorial
JDK1.5 Tutorial
JSF Tutorial
JSP And J2EE Design Tutorial
JSP Tutorial
Spring Tutorial
Struts Tutorial

RESOURCES
Q & A (451 )
Source Code (3275 )
Articles (359 )
Books (372 )
Components (1596 )
News (892 )
Websites (1207 )

SUBMISSIONS
Submit Article
Submit Website
Submit News
Submit Source Code
Submit Component

COMMUNITY
Members Directory
Discussion Forum
Chat

SITE
About Us
Sitemap
Search
Contact Us
Link To Us
Feedback
Tell a Friend
Partners
Advertise

Java java6 Tutorial
 Enhancements for Web Services
  << Prev: ZipInputStream Class To Decompress Zip files Next: Steps to use the Scripting API >>

The Java SE 6 software includes a full web services client stack and supports the latest web services specifications and it provides expanded tools for diagnosing, managing and monitoring applications such as: 



  • JAX-WS 2.0,

  •  JAXB 2.0, STAX and JAXP and it includes a new layout manager component, based on the NetBeans GUI Builder (formerly code named Matisse).

  • SOAP 1.2

  •  




  • XML-binary Optimized Packaging(XOP) and SOAP Message Transmission Optimization Mechanism(MTOM)



 



 Java SE 6 provides support for the JAX- WS web services stack.




  • For the client side: Service class for creating proxy.

  • For the server side: Endpoint class for publication.


 



Server-Side Programming Model




  1. Write a Plain Old Java Object implementing the web service.

  2. Add @WebService to it.

  3. Optionally, add a WebServiceContext

  4. Publish the Web service endpoint through Endpoint.publish() method. Web Service Description Language (WSDL) is automatically generated at runtime. The publish methods can be used to start publishing an endpoint, at which point it starts accepting incoming requests and the stop method can be used to stop accepting incoming requests and take the endpoint  down.

  5.  




  1. Point your clients at the Web Service Description Language (WSDL), for example:

        http://myserver/myapp/MyService

        publishing endpoint creates WSDL and publishes it at runtime.

        http://localhost/sum


Let's take an example:

@WebService

Public class Sum

  {

   @Resource

   WebServiceContext ctx;

   public int add(int a, int b)

    {

     return a+b;

    }

  }

//Create and publish an endpoint

Sum sum=new Sum();

Endpoint endpoint = Endpoint.publish

(http://localhost/sum,sum);




Client-side Programming Model



  1. Point a tool at the WSDL for the service

  2. Generate annotated classes and interfaces through a tool.

  3. Call new on the service class.

  4. Get a proxy using a getxxxPort method.

  5.  




  1. Invoke any remote operations.



 



Let's take an example:



//Create a Service object

SumService sumsrv=new SumService();



// Create a proxy from the Service object

Sum proxy=sumsrv.getSumPort();


//Invoke a Web Service operation

int answer=proxy.add(4,5);


  << Prev: ZipInputStream Class To Decompress Zip files Next: Steps to use the Scripting API >>
Java Java6 Tutorial Home
Give feedback and win a prize.

 
   Printer Friendly
   Email to a friend
   Add to my Favourites    
  Download PDF version
   Report Bad Submissions
   Submit Feedback
 
  Delicious   Digg   Technorati   Blink   Furl   Reddit   Newsvine   Google Click each image to add
this page to each site.
 
 
Welcome Guest Signup
MEMBER'S PANEL
EMAIL
PASSWORD
Forgot your password?
New User? Click Here!
 
Resend Activation Email!
 
SEARCH
 
conference call review
VoIP Internettelefonie AT
 
 
ADVERTISEMENT
Partner List
Code Project
ASP Alliance
More
 
 
 
 

Home | Login | About Us | Contact Us | Privacy Policy | Advertising