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.
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.
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
Introduction to Service Oriented Architectures, SOAP/WSDL Web Services and RE...ecosio GmbH
In this guest talk, held as part of the Web Engineering lecture series 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.
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.
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
Introduction to Service Oriented Architectures, SOAP/WSDL Web Services and RE...ecosio GmbH
In this guest talk, held as part of the Web Engineering lecture series 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.
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.
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.
Getting started with MySQL on Amazon Web ServicesRonald Bradford
Setting up MySQL on Amazon Web Services (AWS)
Ronald Bradford, Principal at 42SQL will step you though getting started with AWS.
This introduction will assume you no nothing about AWS, and have no account. With Internet access via a Browser and a valid Credit Card, you can have your own running Web Server on the Internet in under 10 minutes, just point and click.
We will step into some more detail using the supplied command line tools for more advanced usage.
The Mystical Principles of XSLT: Enlightenment through Software Visualizationevanlenz
The mature XSLT developer has an inner seeing about how a stylesheet works that can seem almost mystical to an outsider. But demystification is possible using an XSLT visualizer, making the structure of a transformation visible. Due to its functional nature, XSLT is particularly well-suited to software visualization, because an XSLT transformation can be represented and viewed as a static dataset. A subset of XSLT visualization (using a “trace-enabled” stylesheet to generate representations of transformation relationships) was used to empower non-programming staff to predict, understand, and manipulate content enrichment rules. We would like to generalize these case-specific techniques into a general tool for XSLT. There are challenges including scalability (memory usage), what to visualize and what not to, avoiding noise for the user, and whether to store annotations externally or within the result document.
Applying an IBM SOA Approach to Manual Processes AutomationProlifics
Abstract: One of the world's largest financial services company is enabling management of client opportunities in an efficient and error free manner by implementing IBM SOA technologies. Integration of IBM BPM, IIB, and WODM, provides seamless transition of manual processes into a state of the art automation. Data persistence and retrieval is assured via IIB business Web services, orchestrated to provide pertinent information access via integration with multiple data sources utilizing various communication means. IBM SOA Web services architecture ensures self-containment, reusability, and adaptability to change, guaranteeing easiness of future integration of any applications irrespective of their communications means or supported platforms.
This presentation was given at Web Directions South in 2008. It is a developers guide to building sites using OpenID, OAuth and webservices - no code, but enough to point you in the right direction
AJAX the Great: The Origin and Development of the Dynamic Web (2007)Fran Fabrizio
This is my all-time favorite presentation that I've delivered. I was invited to address the ACM Student Chapter at UAB, and I thought this topic would appeal to them. Having watched the Web grow up (I got on the Web in 1992 when there was still an index page that listed every new page that had appeared on the web that day!), I thought it would be neat to trace the path from completely static, totally text pages to completely dynamic, asynchronous data delivery that was state of the art in 2007.
International Journal on AdHoc Networking Systems (IJANS)pijans
In recent years, AdHoc networks have been attracting much interest in both academic and industrial communities. International Journal on AdHoc Networking Systems is an open access peer-reviewed journal that serves as a forum to discuss on ongoing research and new contributions. The journal addresses both practical and theoretical research in the areas of ad hoc networks, sensor networks, mesh networks and vehicular networks. Its main focus is on all issues from link layer up to the application layer. The journal solicits original technical papers that were not previously published and are not currently under review for publication elsewhere.
Cloud Native Computing Foundation: How Virtualization and Containers are Chan...Experfy
This course will explain how and why key technologies such as virtualization and containers are influencing the way we architect software today. It also touches upon the challenges that each technology is bringing, along with the pros and cons, It will give the students some hands-on experience with virtualization, containers, kubernetes, and serverless computing.
Check it out: https://www.experfy.com/training/courses/cloud-native-computing-foundation-how-virtualization-and-containers-are-changing-the-way-we-write-software
Concurrency at Scale: Evolution to Micro-ServicesRandy Shoup
Most large-scale web companies have evolved their system architecture from a monolithic application and monolithic database to a set of loosely coupled micro-services. Using examples from Google, eBay, and KIXEYE, this talk outlines the pros and cons of these different stages of evolution, and makes practical suggestions about when and how other organizations should consider migrating to micro-services. It concludes with some more advanced implications of a micro-services architecture, including SLAs, cost-allocation, and vendor-customer relationships within the organization.
Implicitly or explicitly all competing businesses employ a strategy to select a mix
of marketing resources. Formulating such competitive strategies fundamentally
involves recognizing relationships between elements of the marketing mix (e.g.,
price and product quality), as well as assessing competitive and market conditions
(i.e., industry structure in the language of economics).
Premium MEAN Stack Development Solutions for Modern BusinessesSynapseIndia
Stay ahead of the curve with our premium MEAN Stack Development Solutions. Our expert developers utilize MongoDB, Express.js, AngularJS, and Node.js to create modern and responsive web applications. Trust us for cutting-edge solutions that drive your business growth and success.
Know more: https://www.synapseindia.com/technology/mean-stack-development-company.html
Affordable Stationery Printing Services in Jaipur | Navpack n PrintNavpack & Print
Looking for professional printing services in Jaipur? Navpack n Print offers high-quality and affordable stationery printing for all your business needs. Stand out with custom stationery designs and fast turnaround times. Contact us today for a quote!
Falcon stands out as a top-tier P2P Invoice Discounting platform in India, bridging esteemed blue-chip companies and eager investors. Our goal is to transform the investment landscape in India by establishing a comprehensive destination for borrowers and investors with diverse profiles and needs, all while minimizing risk. What sets Falcon apart is the elimination of intermediaries such as commercial banks and depository institutions, allowing investors to enjoy higher yields.
What is the TDS Return Filing Due Date for FY 2024-25.pdfseoforlegalpillers
It is crucial for the taxpayers to understand about the TDS Return Filing Due Date, so that they can fulfill your TDS obligations efficiently. Taxpayers can avoid penalties by sticking to the deadlines and by accurate filing of TDS. Timely filing of TDS will make sure about the availability of tax credits. You can also seek the professional guidance of experts like Legal Pillers for timely filing of the TDS Return.
Digital Transformation and IT Strategy Toolkit and TemplatesAurelien Domont, MBA
This Digital Transformation and IT Strategy Toolkit was created by ex-McKinsey, Deloitte and BCG Management Consultants, after more than 5,000 hours of work. It is considered the world's best & most comprehensive Digital Transformation and IT Strategy Toolkit. It includes all the Frameworks, Best Practices & Templates required to successfully undertake the Digital Transformation of your organization and define a robust IT Strategy.
Editable Toolkit to help you reuse our content: 700 Powerpoint slides | 35 Excel sheets | 84 minutes of Video training
This PowerPoint presentation is only a small preview of our Toolkits. For more details, visit www.domontconsulting.com
Buy Verified PayPal Account | Buy Google 5 Star Reviewsusawebmarket
Buy Verified PayPal Account
Looking to buy verified PayPal accounts? Discover 7 expert tips for safely purchasing a verified PayPal account in 2024. Ensure security and reliability for your transactions.
PayPal Services Features-
🟢 Email Access
🟢 Bank Added
🟢 Card Verified
🟢 Full SSN Provided
🟢 Phone Number Access
🟢 Driving License Copy
🟢 Fasted Delivery
Client Satisfaction is Our First priority. Our services is very appropriate to buy. We assume that the first-rate way to purchase our offerings is to order on the website. If you have any worry in our cooperation usually You can order us on Skype or Telegram.
24/7 Hours Reply/Please Contact
usawebmarketEmail: support@usawebmarket.com
Skype: usawebmarket
Telegram: @usawebmarket
WhatsApp: +1(218) 203-5951
USA WEB MARKET is the Best Verified PayPal, Payoneer, Cash App, Skrill, Neteller, Stripe Account and SEO, SMM Service provider.100%Satisfection granted.100% replacement Granted.
Putting the SPARK into Virtual Training.pptxCynthia Clay
This 60-minute webinar, sponsored by Adobe, was delivered for the Training Mag Network. It explored the five elements of SPARK: Storytelling, Purpose, Action, Relationships, and Kudos. Knowing how to tell a well-structured story is key to building long-term memory. Stating a clear purpose that doesn't take away from the discovery learning process is critical. Ensuring that people move from theory to practical application is imperative. Creating strong social learning is the key to commitment and engagement. Validating and affirming participants' comments is the way to create a positive learning environment.
Improving profitability for small businessBen Wann
In this comprehensive presentation, we will explore strategies and practical tips for enhancing profitability in small businesses. Tailored to meet the unique challenges faced by small enterprises, this session covers various aspects that directly impact the bottom line. Attendees will learn how to optimize operational efficiency, manage expenses, and increase revenue through innovative marketing and customer engagement techniques.
What are the main advantages of using HR recruiter services.pdfHumanResourceDimensi1
HR recruiter services offer top talents to companies according to their specific needs. They handle all recruitment tasks from job posting to onboarding and help companies concentrate on their business growth. With their expertise and years of experience, they streamline the hiring process and save time and resources for the company.
2. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
About Me
• PhD (1993), U of Mannheim
• Member of Strategic Technology
Group, Mitel (1994-1999)
• Assistant Professor, Carleton U
(since 2000)
• Areas of work: service-oriented
architecture, feature
interaction, patterns, business
models, open source
2
3. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Topics Covered
• Service-Oriented Architecture
• Core standards (WSDL, SOAP, UDDI)
• Creating, deploying, and invoking web
services with Apache Axis
• Data mapping and business objects
• Service composition
• A look at some advanced issues
3
4. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Web Services
• What are web services? In essence, a
technology for application integration based
on open standards (HTTP, XML)
• In what sense are they related to the Web
(capital “W” to refer to the WWW)?
• In fact, deploying web services over the web
is more of an artefact than a necessity ...
• What we care about is the web of services
(services assembled from other services)
4
5. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Application Integration
5
Bus
Portal
Applications
User
6. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Defining Web Service
• Loosely coupled, document-based
• Application functionality packaged as a single
unit and exposed to the network
• Authentication service
• Flight departure monitoring service
• Mobile payment service
• The first generation of web services were
“simple”, in the sense of non-composite, and
closed (over existing, trusted relationships)
6
7. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Second Generation Services
• Complex, and aggregated from web services
provided by third parties (hence, open)
7
Rate Quotes
Transit Times Duty and
Taxation
Print Shipping
Labels
Shipping
<<uses>> Organizational
Boundaries
Service
8. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Web of Services
• In second generation
services, applications
are assembled from
services dynamically
• Roles of service user
and provider blend
into what others call
servents (eg in P2P)
Service user
Service provider
Composite
services
8
Servent
9. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Vision
• Build your applications
• Dynamically discover and orchestrate the
execution of services on the network
• Will be able to choose between alternative
implementations of the same service
Application
Services
Implementation
Interface
9
Semantics
on demand
10. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Service-Oriented Architecture
• Objectives
• Implementation transparency (common
structure, neutral service description)
• Location transparency (no hard binding,
web-service agnostic interfaces)
• Roles
• Service Provider
• Service User
• Service Registry
10
11. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Service-Oriented Architecture
11
Service
User
Service
User
Service
Registry
Service
Registry
Service
Provider
Service
Provider
Find
Bind + Invoke
Describe + Publish
UDDI
WSDLSOAP
13. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Topics Covered
• Service-Oriented Architecture
• Core standards (SOAP,WSDL, UDDI)
• Creating, deploying, and invoking web
services with Apache Axis
• Data mapping and business objects
• Service composition
• A look at some advanced issues
13
14. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
SOAP
• Simple Object Access Protocol
• Cross-platform remote calls (de facto, while
technically also document exchange)
• Remote calls (typically) using HTTP as the
transport and XML as the encoding
• Designed to be as simple as possible, so to
make it easily understood and adopted
• But also complete enough to allow complex
data structures to be transmitted
14
15. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
SOAP Messages
• SOAP messages are XML documents usually
sent over HTTP with a certain format
15
16. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
SOAP Messages
• Components of a SOAP message
16
Envelope
Header Body
Payload Fault
1+
optional
required (one)
required (one or more)
17. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
SOAP Containers
• Container accepts incoming requests and
dispatches them to the service
• Translates between SOAP and the native
language of the service (Java, C#, ...)
• Clients only need to know the address of
the service, and messages it understands, but
not what language, platform, or location
17
18. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
SOAP Containers
18
19. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Binding to a Service
• Clients get address and messages from a
WSDL description of the service
19
20. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Client Proxy
• The binding process (dynamically) returns a
proxy to the remote web service
20
21. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
WSDL
• Web Service Description Language
• Neutral format for services to advertise
themselves on the network
• In future, we can choose between competing
providers of same service (price, ...)
• Components of a WSDL description
• Service > Ports > Operations > Messages
• Generating a WSDL description
21
22. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
WSDL Decription
• Components of a web service description
22
Description
Type
1+
Message
1+
Port Type
1+
Operation
1+
Binding
Style
1+
Service
Protocol Port
1+
Binding EndpointRequest Response
1+
optional
required (one)
required (one or more)
23. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Interface
• Consider the interface for a Caching service
that allows users to cache content
23
public String findInCache(String key);
public void cache(String key, String content)
Caching
findInCache
cache
24. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Messages
24
<wsdl:message name="findInCacheRequest">
<wsdl:part name="key" type="soapenc:string"/>
</wsdl:message>
<wsdl:message name="findInCacheResponse">
<wsdl:part name="result" type="soapenc:string"/>
</wsdl:message>
<wsdl:message name="cacheRequest">
<wsdl:part name="key" type="soapenc:string"/>
<wsdl:part name="content" type="soapenc:string"/>
</wsdl:message>
<wsdl:message name="cacheResponse"/>
25. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Port Type
• Port Type
25
<wsdl:portType name="Caching">
<wsdl:operation name="cache" parameterOrder="key content">
<wsdl:input name="cacheRequest"
message="impl:cacheRequest"/>
<wsdl:output name="cacheResponse"
message="impl:cacheResponse"/>
</wsdl:operation>
<wsdl:operation name="findInCache" parameterOrder="key">
<wsdl:input name="findInCacheRequest"
message="impl:findInCacheRequest"/>
<wsdl:output name="findInCacheResponse"
message="impl:findInCacheResponse"/>
</wsdl:operation>
</wsdl:portType>
26. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Service Binding
• Port Type
26
<wsdl:binding name="CachingSoapBinding" type="impl:Caching">
<wsdlsoap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="cache">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="cacheRequest">
<wsdlsoap:body use="encoded" encodingStyle="http://
schemas.xmlsoap.org/soap/encoding/" namespace="urn:Cache"/>
</wsdl:input>
<wsdl:output name="cacheResponse">
<wsdlsoap:body use="encoded" encodingStyle="http://
schemas.xmlsoap.org/soap/encoding/" namespace="urn:Cache"/>
</wsdl:output>
</wsdl:operation>
<!-- SAME FOR findCache operation -->
</wsdl:binding>
27. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Service
• Service ties it all together: it defines one or
more ports, with binding and endpoint
27
<wsdl:service name="CachingService">
<wsdl:port name="Caching"
binding="impl:CachingSoapBinding">
<wsdlsoap:address location=
"http://localhost:9090/axis/services/Caching"/>
</wsdl:port>
</wsdl:service>
28. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
UDDI
• Universal Discovery and Directory Interface
• Service discovery protocol
• Kind of yellow pages which allows
applications to obtain information about
businesses and their web services
• Helps potential business partners to find
each others’ business services
• A system will have some kind of directory,
but not always need all UDDI features
28
29. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Service Directory
• A service directory allows publishers to
publish information about their services, and
users to locate them (and receive updates)
29
User
Provider
Directory
publish
delete
update
locate: ServiceInformation
subscribe
Service
Information
Service
Implementation
30. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
UDDI Structure
• UDDI stores service information in the
form of business entities, business services,
binding templates and technical models
30
Business
Entity
0,,*
Business
Service
Binding
Template
0,,*
0,,*
Technical
Model
0,,*0,,*
31. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Topics Covered
• Service-Oriented Architecture
• Core standards (WSDL, SOAP, UDDI)
• Creating, deploying, and invoking web
services with Apache Axis
• Data mapping and business objects
• Service composition
• A look at some advanced issues
31
32. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Apache Axis
• Open source web service framework
• Client programming model of Axis provides
components for client to invoke a service
endpoint and receive the response message
• Server programming model based on a
listener for each transport protocol, a set of
message handlers, and service handlers
• A detailed discussion of its architecture can
be found at http://ws.apache.org/axis
32
33. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Apache Axis Architecture
33
Tomcat Servlet Container
Apache
Axis
Servlet
Web
Service 1
Web
Service 2
Web
Service 3
Client
34. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Architecture Adapter
• Frameworks such as Apache Axis allow you
to be fully web service-agnostic: to access
web services from Java use method calls via
architecture adapters (eg Java2WS)
34
Java B
eg .Net
35. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Step by Step Guide to Axis
1. Provide a Java interface or class that
describes the service interface
2. Create WSDL using Java2WSDL tool
3. Create bindings through WSDL2Java tool
4. Implement the service interface
5. Deploy the service
6. Implement clients using generated stubs
35
36. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Axis Artefacts and Flow
36
Service
Interface
WSDL
Java2WSDL
Service
Interface
Service
Locator
Service
Stub
WSDL2Java
Client-side files Server-side files
WSDD
Deploy
Service
Binding
Service
Skeleton
Service
WSDD
Undeploy
WSDL2Java
(optional)
Generated User-
defined
37. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Provide a Java Interface
• Define the functionality you want to expose
as a web service using an interface
package cache;
public interface Caching {
public String findInCache(String key);
public void cache(String key, String content)
}
37
Caching
findInCache
cache
1
38. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Interface Segregation
• Achieve greater coherence by limiting your
interfaces to related methods
• Implement multiple ports in one service
38
ContentProviderRetrieval
Billing
Billing
processBilling
Retrieval
retrieveArticle
39. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Create WSDL from Java
• Create the WSDL (Caching.wsdl) from the
Java interface defined earlier
• -o name of output file
• -l location of web service
• -n target namespace of the WSDL document
• -p mapping of namespace to packages
java org.apache.axis.wsdl.Java2WSDL
-o "cache/Caching.wsdl"
-l "http://localhost:8080/axis/services/Caching"
-n "urn:Cache" -p"cache" "urn:Cache"
cache.Caching
39
2
step2.sh
40. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Create WSDL from Java
• Conversion to WSDL will also generate
XML types (using XML Schema) for all non-
primitive types references in the interface
• Supports bean classes, enumeration classes,
arrays, and holder classes (inout)
• No types in this simple example, but a more
complex one will be presented later
40
41. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Create Bindings from WSDL
• While we can create our SOAP messages to
invoke a service at runtime (more later), ...
• ... it is generally better to use WSDL2Java to
convert a WSDL file into Java stubs
41
3
42. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Create Bindings from WSDL
• Create a (static) client-side architecture
adapter using the WSDL2Java tool
• -o name of output file
• -N mapping of namespace to target package
• Adapter classes created
• public interface CachingService
• public class CachingServiceLocator
java org.apache.axis.wsdl.WSDL2Java -o .
-Nurn:Cache cache.stubs cache/Caching.wsdl
42
step3.sh
43. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Implement Service Interface
• Implement the service by implementing the
Caching interface
43
4
public class Cache implements Caching {
protected LinkedHashMap cache = LinkedHashMap(100);
public String findInCache(String key) {
return (String) cache.get(key);
}
public void cache(String key, String content) {
cache.put(key, content);
}
}
44. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
• Separating interface from implementation is a
core element of loose coupling
Cache
findInCache
cache
Caching
findInCache
cache
Client
Interface-Implementation
Separation
44
Dependency Inversion
Principle
45. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Deploy the Service
• In a Web Service Deployment Descriptor
(WSDD) tell Axis how to route requests to
the correct target (service) class
45
5
<deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:
java="http://xml.apache.org/axis/wsdd/providers/java">
<service name="Caching" provider="java:RPC">
<parameter name="className" value="cache.Cache"/>
<parameter name="scope" value="Application"/>
<parameter name="allowedMethods"
value="findInCache cache"/>
</service>
</deployment>
46. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Start the Axis Server
• If the Axis engine is not running start it:
• as a servlet from within a servlet engine
(eg Tomcat): code in webapps/axis
• or as a standalone server (here ... and for
testing and simple applications)
• Invoking the standalone SimpleAxisServer
46
java org.apache.axis.transport.http.SimpleAxisServer
-p 9090
axis.sh
47. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
AdminClient
• Make the service available to clients by
deploying it using the AdminClient
• If deploying to the standalone Axis server,
also supply the port number
• Now we are ready to invoke the service
47
> java org.apache.axis.client.AdminClient
-p 9090 deploy.wsdd
Processing file cache/deploy.wsdd
<Admin>Done processing</Admin>
admin.sh
48. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Create the Client
• There are two ways to invoke a service
• Dynamic client: create a Call object for
each method at runtime
• Static client: generate a static proxy from
the WSDL description
48
5
49. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Dynamic Client
49
public class DirectCachingClient {
public static void main(String[] args) {
try {
String endpoint =
"http://localhost:9090/axis/services/Caching";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(endpoint));
call.setOperation("findCache");
call.setReturnType(XMLType.XSD_STRING);
String ret = (String) call.invoke(
new String[] {"theAnswer"});
System.out.println("Received: " + ret);
} catch (Exception e) {
System.err.println("Exception: " + e);
}
}
}
50. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Static Client
50
public class CachingClient {
public static void main(String[] args) {
try {
CachingService service = new CachingServiceLocator();
Caching port = service.getCaching();
// to access the service at a different endpoint:
// Caching port = service.getCaching(url);
String answer = port.findInCache("theAnswer");
if (answer == null) {
port.cache("theAnswer", "42");
}
answer = port.findInCache("theAnswer");
System.out.println(answer);
} catch (Exception e) {
System.err.println("Exception: " + e);
}
}
}
51. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Setting up Axis
• Download Apache Axis from website
• http://ws.apache.org/axis
• Latest stable release is axis-bin-1_4.zip
• Install in a directory and put the .jar files in
the axis/lib directory into your class path
• In my Unix shell, I would say
51
set AXIS_HOME="$home/axis"
set CLASSPATH="${CLASSPATH}:$AXIS_HOME/lib/axis-ant.jar"
set CLASSPATH="${CLASSPATH}:$AXIS_HOME/lib/axis.jar"
...
52. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Axis User Guide
http://ws.apache.org/axis/java/user-guide.html
52
for more information
53. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Case Study: Bookstore
• As a larger example, consider an application
for ordering books from multiple stores
• This application needs to provide a portal
through which users can place orders
• It invokes the (different?) order processing
services provided by the bookstores
• First, the big picture ...
53
54. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
WSDL Repository/
UDDI Registry
Bookstore
1
Bookstore
2
Bookstore
3
Axis Engine
OrderProcessing
Stub 1
OrderProcessing
Stub 1
WSDL
Client
Stubs
Portal
OrderProcessing
Stub(s)
Deploy
Invoke
Actual
calls
1
1
2
3
4
5
Actors and Interactions
54
55. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Interface
• The bookstore exposes an OrderProcessing
interface through which to place orders
• Orders can also be canceled given their OID
55
public interface OrderProcessing {
public String processOrder(String customer, String[] isbns,
int[] quantities);
public void cancel(String oid);
}
Bookstore
processOrder
cancel
OrderProcessing
56. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
WSDL and Stubs
• Generate the WSDL from the interface
• Generate client stubs from the WSDL
56
step2.sh bookstore_v1 OrderProcessing Bookstore
bookstore_v1
OrderProcessing.wsdl
step3.sh bookstore_v1 OrderProcessing Bookstore
bookstore_v1.stubs
OrderProcessingServiceLocator
OrderProcessingService
OrderProcessing
OrderProcessingStub
57. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Service (1)
• Much of the following code is stubbed out,
as it is not related to web services
57
public class Bookstore implements OrderProcessing {
// ...
public String processOrder(String customer, String[] isbns,
int quantities[]) {
String oid = generateOid();
Order order = new Order(customer, isbns, quantities);
orders.put(oid, order);
// do whatever else to initiate payment processing
// and shipping (not shown ...)
return oid;
}
58. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Service (2)
• And to finish off ...
58
// ...
public void cancel(String oid) {
Order o = (Order) orders.get(oid);
if (o != null) {
orders.remove(oid);
// do whatever is needed to cancel the order
}
}
private String generateOid() {
return "o" + nextOid++;
}
}
59. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Deploy the Service
• Deployment descriptor for the bookstore is
similar to that for the Caching service
59
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service name="OrderProcessing" provider="java:RPC">
<parameter name="className" value="bookstore_v1.Bookstore"/>
<parameter name="scope" value="Application"/>
<parameter name="allowedMethods" value="processOrder cancel"/>
</service>
</deployment>
60. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Client
60
public class BookstoreClient {
public static void main(String[] args) {
try {
OrderProcessingService service =
new OrderProcessingServiceLocator();
OrderProcessing port = service.getOrderProcessing();
String oid = port.processOrder("joe@doe.com",
new String[] {"123456", "732541"},
new int[] {2, 1});
System.out.println("order " + oid + " placed");
port.cancel(oid);
System.out.println("order " + oid + " canceled");
} catch (Exception e) {
System.err.println("Exception: " + e);
}
}
}
61. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Topics Covered
• Service-Oriented Architecture
• Core standards (WSDL, SOAP, UDDI)
• Creating, deploying, and invoking web
services with Apache Axis
• Data mapping and business objects
• Service composition
• A look at some advanced issues
61
62. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Business Objects
• Represent highly cohesive business concepts
such as order, line item, or address
• Also known as data objects or beans, ie they
only contain data access operations
• Business objects often collected in groups
• But rich object structures are in conflict
with the flat nature of web services
• Focus of web services on loose coupling, so
unlike CORBA or RMI no OO focus
62
63. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Taking Orders now!
• Business objects can contain primitive and
complex data as in the Order example
63
Order
customer: String
lineItems: LineItem[]
setCustomer
getCustomer: String
setLineItems
getLineItems: LineItem[]
LineItem
isbn: String
quantity: int
setIsbn
getIsbn: String
setQuantity
getQuantity: int
*
64. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Data Mapping to XML
• Basic mapping defined by JAX-RPC spec
• Mapping of primitive types
• Complex types that follow the JavaBeans
convention (BeanSerializer)
• Arrays and some Collection types
• Exceptions
• Key consideration is the interoperability
between SOAP implementations !
64
65. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Mapping of Primitive Types
• Primitive types
defined in
standard SOAP
encoding
65
66. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Complex Types
• Axis can serialize and deserialize any classes
that follow the JavaBeans convention ...
• ... without requiring you to write any code !
• Simple properties
• setAddress and getAddress
• Indexed properties (arrays of values)
• Customer[]
• setCustomers and getCustomers
66
67. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Bean Mapping
• Need to define a bean mapping in WSDD by
adding a <beanMapping> tag
• Maps a Java bean to an XML qualified name
(qname) associated with a namespace
<beanMapping qname="ns:Order" xmlns:ns="urn:Bookstore"
languageSpecificType="java:bookstore_v2.Order"/>
67
68. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Orders in XML
• XML schema for the Order type
68
<complexType name="Order">
<sequence>
<element name="customer" type="soapenc:string" .../>
<element name="lineItems" type="impl:ArrayOfLineItem" .../>
</sequence>
</complexType>
<complexType name="LineItem">
<sequence>
<element name="isbn" type="soapenc:string" .../>
<element name="quantity" type="xsd:int" .../>
</sequence>
</complexType>
69. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Order (simple)
• The Java Beans convention distinguishes
simple and indexed properties
public class Order {
protected String customer;
public String getCustomer() {
return customer;
}
public void setCustomer(String customer) {
this.customer = customer;
}
// ...
69
70. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Order (indexed)
• In the Order class, line items are indexed
// ...
private LineItem[] lineItems;
public LineItem[] getLineItems() {
return lineItems;
}
public void setLineItems(LineItem[] lineItems) {
this.lineItems = lineItems;
}
}
70
71. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Arrays and Collections
• Some Java collections (Vector, Hashtable, ...)
have serializers, but interoperability between
SOAP implementations in not guaranteed
• Most reliable way, thus, is to use arrays
<complexType name="ArrayOfLineItem">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType"
wsdl:arrayType="impl:LineItem[]"/>
</restriction>
</complexContent>
</complexType>
71
72. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Bookstore
• New interface to our bookstore that uses
business objects (ie Order)
72
public class Bookstore implements OrderProcessing {
// ...
public String processOrder(Order order) {
String oid = generateOid();
orders.put(oid, order);
// do whatever else to initiate payment processing
// and shipping (not shown ...)
return oid;
}
// ...
}
73. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Bookstore Client
public class BookstoreClient {
public static void main(String[] args) {
try {
OrderProcessingService service =
new OrderProcessingServiceLocator();
OrderProcessing port = service.getOrderProcessing();
Order order = new Order("joe@doe.com", new LineItem[] {
new LineItem("123456", 2),
new LineItem("732541", 1)
});
String oid = port.processOrder(order);
System.out.println("order " + oid + " placed");
port.cancel(oid);
System.out.println("order " + oid + " canceled");
} catch (Exception e) {
System.err.println("Exception: " + e);
}
}
}
73
74. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
WSDD for Bookstore
• Define complex types on which the service
implementation relies in the WSDD
• namespace (urn:Bookstore)
• serializers (beanMapping to ns:Order)
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service name="OrderProcessing" provider="java:RPC">
<parameter name="className" value="bookstore_v2.Bookstore"/>
<parameter name="allowedMethods" value="processOrder cancel"/>
<beanMapping qname="ns:Order" xmlns:ns="urn:Bookstore"
languageSpecificType="java:bookstore_v2.Order"/>
<beanMapping qname="ns:LineItem" xmlns:ns="urn:Bookstore"
languageSpecificType="java:bookstore_v2.LineItem"/>
</service>
</deployment>
74
75. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Topics Covered
• Service-Oriented Architecture
• Core standards (WSDL, SOAP, UDDI)
• Creating, deploying, and invoking web
services with Apache Axis
• Data mapping and business objects
• Service composition
• A look at some advanced issues
75
76. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Business Processes
• Means by which one or more activities are
accomplished in an operating business
• Business process models include
• Roles of users
• Definition of activities
• Can be represented diagrammatically as as
activity diagrams, use case maps, ...
• Concerned with structure and interfaces
76
77. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Business Process Components
• Business processes model business
operation, vs business objects which model
(data) entities within a business
• Purely look at a business from the aspect of
the activities the business conducts
• Activities can be composed into larger
business processes, and may be business
processes themselves, or web services
• We are concerned with composition
77
78. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Ordering Process
78
Select Products
to Order
Enter Customer
Information
Submit Product
Order
Create Order
Remove from
Warehouse
Ship ProductsReceive
Products
Customer Store
79. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Business Processes in Practice
• Business process concepts overlap with
existing architectures and styles
• The tended to be part of the custom logic
outside the business object model
• Business process implementations differ
largely between organizations
• Large business processes often span multiple
companies (need to integrate processes)
• Motivates need to support fluidity
79
80. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Business Process Modeling
• Several standards for modeling and
representing business processes
• Business Process Execution Language (BPEL)
• IBM, Microsoft, BEA
• Business Process Modeling Language (BPML)
• XML-based explicit representation of
business process flow model
80
81. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Marginalized Objects
• We have discussed this before ...
• Applied to business processes this means
that business processes require a flat
component model with interface definition
and implementation
• Each interface is implemented as the
composition of web services
• Also applied to flow logic by moving it out
from the programming language (BPEL !)
81
82. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Process Logic in BPEL
Client Web Service
businessProcess()
BPEL Container
invoke()
receive()
reply()
wait()
terminate()
sequence()
pick()
flow()
BPEL Flows
82
83. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Business Process Pattern
<<interface>>
BusinessActivity
run()
BusinessActivityImpl
run()
<<interface>>
BusinessProcess
run()
ActivitySequence
next()
get()
Data
get()
set()
BusinessProcessImpl
run()
83
84. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Participants
• BusinessProcess
• Interface to the business process
• BusinessProcessImpl
• Logic of the business process, which can
be a simple ActivitySequence
• ActivitySequence
• Sequence of business activities that must
occur before process is complete
84
85. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
More Participants
• Data
• Captures side effects of business activities
(in this pattern: a shared data pool)
• BusinessActivity
• Unit of work in the business process,
which may itself be a process, a service, or
just a single method on an object
85
86. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Ordering Process
• Customer submits an order
• Business process puts order into data pool
• ... determines if products exist (success) in
warehouse, and reserves them
• ... checks state of data pool and launches
create order business activity
• ... notifies warehouse staff to ship
• ... returns an order identifier to the user
86
87. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Product Order Process
<<interface>>
BusinessActivity
setData()
run()
isComplete()
getReturnValue()
isSuccessful()
CreateOrder
run()
RemoveProduct
Quantity
run()
ActivitySequence
next()
get()
ProductOrderImpl
createProductOrder()
run()
ShipProducts
run()
BusinessProcess
run()
ProductOrderWeb
Service
createProductOrder()
Hashtable
87
88. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Topics Covered
• Service-Oriented Architecture
• Core standards (WSDL, SOAP, UDDI)
• Creating, deploying, and invoking web
services with Apache Axis
• Data mapping and business objects
• Service composition
• A look at some advanced issues
88
89. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Advanced Issues
89
Workflows
Mobile
Services
QoS/Policy
Security
Coordination
Semantics
Web
Services
90. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Client-Server
Desktops
N-Tier
Spaces
Embedded Networks
Agents
Web services
Grids
P2P
Distributed Objects
}
Social Computing
Utility
Semantic Web
Coordination Media
} Semantic Grid
} MirrorWorld
1990's
2000's
20??'sUbiquitous Computing
Convergence
90
91. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Summary
• Concepts
• Service-oriented architecture, core standards,
data mapping, and business processes
• Principles
• Interface/implementation separation, top-down/
bottom-up design, interface segregation, ...
• Patterns
• SOA,Architecture Adapter, Service Directory,
Business Object, Service Composition
• Tools
• Apache Axis
91
92. Michael Weiss • Montreal Conference on eTechnologies • May 17-19, 2006
Further Reading
• Taylor, From P2P toWeb Services and Grids:
Peers in a Client/Server World, Springer
• Monday,Web Service Patterns,APress
• Pashtan, Mobile Web Services, Cambridge
• Sotomayor, Globus Toolkit 4: Programming
Java Services, Morgan Kaufmann
• Papazoglou,Web Services and Cross
Enterprise Computing,Addison-Wesley
92