This document provides an overview of Java APIs for XML web services, including JAX-RPC and JAX-WS. It discusses the Java Web Services Development Pack (JWSDP) and its components like JAXP, JAXB, SAAJ. It then describes specific APIs like JAX-RPC, JAX-WS, JAXR. It also discusses the server-side and client-side programming models in JAX-WS including using annotations and generating code from WSDL.
JAX-WS is the replacement and next generation to JAX-RPC and makes web services development much easier using annotations and much less configuration. JAX-WS is useful for people building webservices/SOA based infrastructure as JAX-WS makes the web service development much easier and is a big gain for developer productivity.
The session uses a web service for temperature conversion example to build both the client side and Server side artifacts. Also on the server side both Servlet based and EJB3.0 based web service development will be demonstrated. JAXB concepts will be used to demonstrate the examples.
The session uses Eclipse Ganymede and Jboss 5.0. However JAX-WS being the standard, the code will smoothly work on any JavaEE based compliant servers.
Overview of JAX-WS technology for web services (Java API for XML Web Services).
JAX-WS is the core Java web service technology for Java EE applications.
It provides a unified client and server-side API for writing SOAP/WSDL based web services.
JAX-WS is platform independent. Many Java platforms like Glassfish, Axis2 or CXF support JAX-WS.
Thus services developed with JAX-WS on one platform can be easily ported to another platform.
JAX-WS is based on annotations like @WebService thus greatly simplifying the development of web services.
POJOs (Plain Old Java Objects) can be simply annotated with JAX-WS annotations thus turning these into web service implementations.
JAX-WS is the core web service technology according to JSR-224 affording basic web service functionality.
WSIT (Web Service Interoperability Technology) sits on top of JAX-WS and adds enhanced functionality like security, reliability and transactions.
WSIT is the standard Java WS protocol stack beyond basic WS functionality (SOAP, WSDL) to achieve interoperability between Java and .Net (for more complex applications that go beyond simple WS requests).
Overview of web services, SOAP, WSDL and UDDI.
A web service provides a defined set of functionality on a machine-processable interface.
The web service interface is described in a formal language like WSDL that allows creating code to access the service thus simplifying web service consumer (client) and provider (server) development.
In big web services, the interface is typically described in WSDL while the access to the service makes use of the SOAP message protocol.
SOAP has its roots in remote object access but is now a general message based and asynchronous transport mechanism.
SOAP is typically carried in HTTP (HyperText Transmission Protocol), but other message based protocols like SMTP (Email) or plain TCP could be used as well.
WSDL provides a formalized description of an interface that is coarsely separated in an abstract service interface definition containing operations and data types, a transport binding that describes how the web service is accessed and finally a description of the location (address) under which a web service is accessible.
UDDI (Universal Description and Discovery Protocol) was meant to become the standard protocol for some kind of a public yellow pages where publicly accessible web services would be listed. Lack of industry interest, however, prevented UDDI to gain widespread use.
Introduction to SOAP/WSDL Web Services and RESTful Web Servicesecosio GmbH
In this talk, held as part of the Web Engineering lecture series 2015 at Vienna University of Technology, we give an overview of the current state of the art in the domain of Web Services.
In the first part we dwell on the main principles of Service Oriented Architectures (SOA), followed by an introduction of the three core standards SOAP, WSDL, as well as UDDI. Furthermore, we briefly cover the Java API for XML Web Services (JAX-WS).
In the second part we focus on principles of RESTful Web Services and the Java API for RESTful Web Services. The lecture is accompanied by practical examples, which are also available on GitHub.
JAX-WS is the replacement and next generation to JAX-RPC and makes web services development much easier using annotations and much less configuration. JAX-WS is useful for people building webservices/SOA based infrastructure as JAX-WS makes the web service development much easier and is a big gain for developer productivity.
The session uses a web service for temperature conversion example to build both the client side and Server side artifacts. Also on the server side both Servlet based and EJB3.0 based web service development will be demonstrated. JAXB concepts will be used to demonstrate the examples.
The session uses Eclipse Ganymede and Jboss 5.0. However JAX-WS being the standard, the code will smoothly work on any JavaEE based compliant servers.
Overview of JAX-WS technology for web services (Java API for XML Web Services).
JAX-WS is the core Java web service technology for Java EE applications.
It provides a unified client and server-side API for writing SOAP/WSDL based web services.
JAX-WS is platform independent. Many Java platforms like Glassfish, Axis2 or CXF support JAX-WS.
Thus services developed with JAX-WS on one platform can be easily ported to another platform.
JAX-WS is based on annotations like @WebService thus greatly simplifying the development of web services.
POJOs (Plain Old Java Objects) can be simply annotated with JAX-WS annotations thus turning these into web service implementations.
JAX-WS is the core web service technology according to JSR-224 affording basic web service functionality.
WSIT (Web Service Interoperability Technology) sits on top of JAX-WS and adds enhanced functionality like security, reliability and transactions.
WSIT is the standard Java WS protocol stack beyond basic WS functionality (SOAP, WSDL) to achieve interoperability between Java and .Net (for more complex applications that go beyond simple WS requests).
Overview of web services, SOAP, WSDL and UDDI.
A web service provides a defined set of functionality on a machine-processable interface.
The web service interface is described in a formal language like WSDL that allows creating code to access the service thus simplifying web service consumer (client) and provider (server) development.
In big web services, the interface is typically described in WSDL while the access to the service makes use of the SOAP message protocol.
SOAP has its roots in remote object access but is now a general message based and asynchronous transport mechanism.
SOAP is typically carried in HTTP (HyperText Transmission Protocol), but other message based protocols like SMTP (Email) or plain TCP could be used as well.
WSDL provides a formalized description of an interface that is coarsely separated in an abstract service interface definition containing operations and data types, a transport binding that describes how the web service is accessed and finally a description of the location (address) under which a web service is accessible.
UDDI (Universal Description and Discovery Protocol) was meant to become the standard protocol for some kind of a public yellow pages where publicly accessible web services would be listed. Lack of industry interest, however, prevented UDDI to gain widespread use.
Introduction to SOAP/WSDL Web Services and RESTful Web Servicesecosio GmbH
In this talk, held as part of the Web Engineering lecture series 2015 at Vienna University of Technology, we give an overview of the current state of the art in the domain of Web Services.
In the first part we dwell on the main principles of Service Oriented Architectures (SOA), followed by an introduction of the three core standards SOAP, WSDL, as well as UDDI. Furthermore, we briefly cover the Java API for XML Web Services (JAX-WS).
In the second part we focus on principles of RESTful Web Services and the Java API for RESTful Web Services. The lecture is accompanied by practical examples, which are also available on GitHub.
The slides provide a major overview on SOAP protocol, and demonstrates a working example that uses SOAP for RPC. It uses WCF/visual studio and Apache Axis for the implementation.
The slides provide a major overview on SOAP protocol, and demonstrates a working example that uses SOAP for RPC. It uses WCF/visual studio and Apache Axis for the implementation.
Writing simple web services in java using eclipse editorSantosh Kumar Kar
This is a simple steps showing how you can write a simple web service, host into a server, write a client class to access the service on web server. Just for a beginners...
1. Introduction to Web Services
2. Web Service Architecture
3. What are Web Services?
4. Why are Web Services?
5. The base of WS
6. What is SOAP?
7. What is WSDL?
8. How to test a web service?
9. Examples
Web services tutorial slides from my session at DPC 2012 in Amsterdam. In this 3-hour session we built the simplest possible service, and then extended it, looking at RPC, REST and SOAP along the way.
Testing web services is very important part of integration testing on web projects.
In this presentation you can learn the best approaches, tools and features of Web Services testing. Soon I'll share url with a video from my presentation.
Soa 12 jax ws-xml Java API for web servicesVaibhav Khanna
Service Oriented Architecture : JAX-WS-XML Java API for web services, and establishing a communication brige with XML. An API to replace JAX RPC Java Remote Procedure Call mechanism
(ATS4-DEV04) Protocols as RESTful Services and RESTful URL RoutingBIOVIA
Accelrys Enterprise Platform 9.0 includes some significant enhancements to support the deployment of Pipeline Pilot protocols as web services.
This session will bring you up to date on the different styles of web service and options for deployment to end users and web service clients. You will also learn about techniques for publishing services using a standard REST-based model. The session will focus on practical demonstrations of taking Pipeline Pilot protocols and delivering them as REST-based web services.
Intro To Web and Web Services (REST Series 01)Heartin Jacob
This is the first session for REST web services course. You may skip this session if you already know HTTP and Servlets, and also if you don’t want to learn anything about SOAP. However, learning about HTTP and Servlets are essential for working with REST web services. Also, a basic idea of SOAP will always be good to understand the benefits of REST better and also to take a decision on whether you need to learn SOAP more in depth.
What's New and Noteworthy on Oracle CAF 12.1.3Bruno Borges
Oracle CAF - Cloud Application Foundation - delivers top quality Java Middleware software for mission critical solutions. Find out what's new and noteworthy on CAF 12.1.3, mainly WebLogic and Coherence.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...SOFTTECHHUB
The choice of an operating system plays a pivotal role in shaping our computing experience. For decades, Microsoft's Windows has dominated the market, offering a familiar and widely adopted platform for personal and professional use. However, as technological advancements continue to push the boundaries of innovation, alternative operating systems have emerged, challenging the status quo and offering users a fresh perspective on computing.
One such alternative that has garnered significant attention and acclaim is Nitrux Linux 3.5.0, a sleek, powerful, and user-friendly Linux distribution that promises to redefine the way we interact with our devices. With its focus on performance, security, and customization, Nitrux Linux presents a compelling case for those seeking to break free from the constraints of proprietary software and embrace the freedom and flexibility of open-source computing.
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Threats to mobile devices are more prevalent and increasing in scope and complexity. Users of mobile devices desire to take full advantage of the features
available on those devices, but many of the features provide convenience and capability but sacrifice security. This best practices guide outlines steps the users can take to better protect personal devices and information.
Unlocking Productivity: Leveraging the Potential of Copilot in Microsoft 365, a presentation by Christoforos Vlachos, Senior Solutions Manager – Modern Workplace, Uni Systems
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Climate Impact of Software Testing at Nordic Testing DaysKari Kakkonen
My slides at Nordic Testing Days 6.6.2024
Climate impact / sustainability of software testing discussed on the talk. ICT and testing must carry their part of global responsibility to help with the climat warming. We can minimize the carbon footprint but we can also have a carbon handprint, a positive impact on the climate. Quality characteristics can be added with sustainability, and then measured continuously. Test environments can be used less, and in smaller scale and on demand. Test techniques can be used in optimizing or minimizing number of tests. Test automation can be used to speed up testing.
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
4. JWSDP
Java Web Services Development Pack (JWSDP) is a free
software development kit (SDK) for developing Web
Services
JWSDP has been replaced by GlassFish and WSIT and
several components are in Java SE 6.
JWSDP APIs
Java API for XML Processing (JAXP), v 1.3
Java Architecture for XML Binding (JAXB), v 1.0 and 2.0
JAX-RPC v 1.1
JAX-WS v 2.0
SAAJ (SOAP with Attachments API for Java)
Java API for XML Registries (JAXR)
4
5. Java API for XML Processing (JAXP)
• JAXP enables applications to parse, validate and
transform XML documents.
• Java developers can invoke
• SAX parser
• DOM parser
• The main JAXP APIs are defined in the
javax.xml.parsers package
• SAXParserFactory
• DocumentBuilderFactory
5
6. Java API for XML Binding (JAXB)
• JAXB allows Java developers to access and process XML data
without having to know XML or XML processing.
• JAXB is a Java technology that enables you to generate Java
classes from XML schemas by means of a JAXB binding
compiler.
• unmarshalling
• XML instance documents into Java content trees
• marshalling
• Java content trees back into XML instance documents.
6
7. SAAJ (SOAP with Attachments
API for Java™)
• SAAJ provides a convenient API for constructing
and sending SOAP messages without having to
directly create the XML yourself.
• SAAJ was originally part of the Java API
for XML Messaging (JAXM) Separated out from
JAXM 1.0 into JAXM 1.1 and SAAJ 1.1
(SAAJ 1.3 (Java EE 5))
7
8. JAXR
• Standard Java API for performing registry operations
over diverse set of registries
Web service publication & discovery
• A unified information model for describing business
registry content
• Provides multi-layered API abstractions
Level 0: for UDDI
Level 1: for ebXML registry/repository
8
9. JAX-RPC
• XML data types to/from Java types mapping
• SOAP Message Handler framework
• WSDL to/from Java mapping
• Servlet-based Web service endpoint model
• JAX-RPC Client Programming Models
• Extensible type mapping
9
10. JAX-WS (JAX-RPC 2.0)
• New handler framework
• Metadata-based Web services
• Operational style improvement
• Asynchronous Web services
• Support for non-HTTP transport
• Interoperable attachments (as part of WS-I)
• Secure Web services (as part of Security)
10
11. JAXM
• JAXM is not part of Java EE 5
• JAXM-based asynchronous messaging on Java EE 5
is supported via
Message-driven Bean (MDB) in EJB 3 can receive
both JMS and JAXM message types
Connector 1.5 allows pluggability of various types
message providers (JAXM provider and JMS
provider)
11
15. Remote Procedure Call (RPC)
Request
Response
Client System Server System
RPC, COM, CORBA, RMI:
Synchronous communication: calling process blocks until
there is a response
More tightly coupled (than non-RPC model): client must
find recipients and know method and its arguments
Non persistent
16. Remote Procedure Calls
Client Interface Interface Servant
Stub Skeleton
Run Time Protocol Run Time
Common Interface between client and Server
Stub for client, Skeleton/Tie for server
On-the-wire protocol needs to be agreed upon
17. RPC Example – Java RMI
<<Interface>>
Java Remote
Interface
rmic compiler
Client Remote Object
Implementation
RMI Client RMI Server
Stub Skeleton
Java Remote Method Protocol (JRMP) is
On-the-wire protocol
19. Common Interface
Service is described in IDL (Interface Description
Language)
IDL ofCORBA service
Java RMI interface in RMI (Language specific)
WSDL for Web service
Used by tools to statically or dynamically generate
and/or configure interfaces, proxies, and ties in a
network technology specific environment
20. What is JAX-RPC?
Java™ API for XML-based RPC
Web Services operations are performed by exchanging
SOAP 1.1 messages
Services are described using WSDL
• WSDL is the contract between service provider and
client (only contract needed)
Web service endpoints and clients use JAX-RPC
programming model
Key technology for Web Services in the J2EE 1.4
platform
21. JAX-RPC Design Goals
Easy to use programming model
• For both defining & using a service
Hides all the plumbing
• You don't have to create SOAP messages yourself
SOAP and WSDL-based interoperability
• Interoperate with any SOAP 1.1 compliant peers
Extensibility and Modularity
• Support new versions of XML specification, i.e. SOAP 1.2
and beyond
• Message handler architecture
22. JAX-RPC Architecture
JAX-RPC JAX-RPC
Client WSDL Document Service Endpoint
Generated JavaWSDL WSDLJava
Code
Container Container
Client-side JAX-RPC Server-side JAX-RPC
Runtime System Runtime System
SOAP
HTTP
23. JAX-RPC Runtime System
Core of a JAX-RPC implementation:
• Library that provides runtime services
for JAX-RPC mechanisms
• Implements some of the JAX-RPC APIs
Client side:
• Can be implemented over J2SE™, J2EE™ or J2ME™
platforms
Server-side:
• J2EE 1.3 or 1.4 Containers: EJB™ or Servlet
24. Developing a Web Service
Interfaces (java.rmi.Remote type)
Must follow JAX-RPC conventions
Implementation classes
Servlet-based endpoint model
Optional handler and serializer classes
tool
WSDL Service contract
Packaged application (war file)
25. JAX-RPC : Web Service Endpoint
JAX-RPC
Service Endpoint
WSDL<-->Java
WSDL Document Container
Server-Side
JAX-RPC
Runtime
System
SOAP
HTTP
27. Quick overview of JAX-WS
Easy way to use Java API for XML Web Services
Replace JAX-RPC
Just add @annotation to POJO
XML Descriptor free programming
Layer architecture
SOAP 1.2 (Document/Literal)
Use JAXB for data binding
Protocol and transport independence
Part of Java SE6 and Java EE 5 Platform
27
29. What Does It Mean?
• Upper layer uses annotations extensively
• Easy to use
• Great toolability
• Fewer generated classes
• Lower layer is more traditional
• API-based
• For advanced scenarios
• Most application will use the upper layer only
• Either way, portability is guaranteed
29
30. Two ways to create a Web Service
• Starting from a WSDL file
> Generate classes using wsimport (=> xjc)
> WS interface
> WS implementation skeleton class
> Implement WS interface
> Build and deploy
• Starting from a Java class (POJO)
> Annotate POJO
> Build and deploy
> WSDL file generated automatically
30
32. Server-Side Programming Model: POJO
1 Write a POJO implementing the service
2 Add @WebService annotation to it
3 Build and Deploy the application
WSDL is automatically generated at runtime
1 Point your clients at the WSDL
e.g. http://myserver/myapp/MyService?WSDL
32
33. Example 1: Servlet-Based Endpoint
@WebService
public class Calculator {
public int add( int a, int b) {
return a + b;
}
}
• @WebService annotation
• All public methods become web service operations
• WSDL/Schema generated automatically
• Default values are used
33
35. Example 2: EJB-Based Endpoint
@WebService
@Stateless
public class Calculator {
public int add( int a, int b) {
return a + b;
}
}
• It’s a regular EJB 3.0 component, so it can use any
EJB features
> Transactions, security, interceptors...
35
45. Java SE Client Side Programming
• Point a tool (NetBeans or wsimport) at the WSDL
for the service
wsimport http://example.org/Calculator.wsdl
• Generate annotated classes and interfaces
• Call new on the service class
• Get a proxy using a get<ServiceName>Port method
• Invoke any remote operations
45
46. Example : Java SE-Based Client
CalculatorService svc = new CalculatorService();
Calculator proxy = svc.getCalculatorPort();
int answer = proxy.add(35, 7);
• No need to use factories
• The code is fully portable
• XML is completely hidden from programmer
46
47. Java EE Client Side Programming
• Point a tool (NetBeans or wsimport) at the WSDL
for the service
wsimport http://example.org/calculator.wsdl
• Generate annotated classes and interfaces
• Inject a @WebServiceReference of the
appropriate type
• No JNDI needed
• Invoke any remote operations
47
48. Example : Java EE-Based Client
@Stateless
public class MyBean {
// Resource injection
@WebServiceRef(CalculatorService.class)
Calculator proxy;
public int mymethod() {
return proxy.add(35, 7);
}
48
50. Annotations Used in JAX-WS
• JSR 181: Web Services Metadata for the
Java Platform
• JSR 222: Java Architecture for XML
Binding (JAXB)
• JSR 224: Java API for XML Web Services
(JAX-WS)
• JSR 250: Common Annotations for the
Java Platform
51. @WebService
• Marks a Java class as implementing a
Web Service, or a Java interface as
defining a Web Service interface.
• Attributes
> endpointInterface
> name
> portName
> serviceName
> targetNamespace
> wsdlLocation
52. @WebMethod
• Customizes a method that is exposed as
a Web Service operation
• The method is not required to throw
java.rmi.RemoteException.
• Attributes
> action
> exclude
> operationName
53. @WebParam
• Customizes the mapping of an individual
parameter to a Web Service message
part and XML element.
• Attributes
> header
> mode
> name
> partName
> targetNamespace
54. @WebResult
• Customizes the mapping of the return
value to a WSDL part and XML element.
• Attributes
> header
> name
> partName
> targetNamespace
55. JAX-WS - Provider
• Web Service endpoints may choose to work at
the XML message level by implementing the
Provider interface.
• The endpoint accesses the message or
message payload using this low-level, generic
API
• Implement one of the following
> Provider<Source>
> Provider<SOAPMessage>
> Provider<DataSource>
57. JAX-WS - Dispatch
• Web service client applications may choose to
work at the XML message level by using the
Dispatch<T> APIs.
• The javax.xml.ws.Dispatch<T> interface
provides support for the dynamic invocation of
service endpoint operations.
• Similar to Provider on server side
59. Resources
Some contents are borrowed from the presentation
slides of Sang Shin, Java™ Technology Evangelist,
Sun Microsystems, Inc.
Web Services and Java, Elsa Estevez, Tomasz
Janowski and Gabriel Oteniya, UNU-IIST, Macau
59
60. Thank you
thananum@gmail.com
www.facebook.com/imcinstitute
www.imcinstitute.com
60