1. Web Services
Alessio Soldano
alessio.soldano@jboss.com
Principal Software Eng.
JBoss - Red Hat
April 12th, 2012
2. Who is Alessio?
● JBoss WS[1] committer since early 2007
● JBoss / Red Hat employee since end of 2007
● JBoss Web Service Lead, 2008
● Contributor to JBoss AS[2] and other JBoss
Community projects
● Current Red Hat representative at JSR-224 EG
and W3C WS-ResourceAccess WG
● Apache CXF[3] committer and PMC member
[1] http://www.jboss.org/jbossws [2] http://www.jboss.org/jbossas
[3] http://cxf.apache.org
3. Agenda
● What is JBoss WS ?
● Apache CXF integration
● Features
● JBoss AS 7.1
● Key features
● WS components
● Demo
4. What is JBossWS?
● “Just” a feature-rich JAX-WS compatible ws
stack till early 2008...
– AS 4.x, AS 5.x target containers
● ... a web services framework providing
integration layers for 3rd party ws stacks on top
of multiple JBoss AS versions
– CXF, Native and Metro stack
– AS 5.x, AS 6.x target containers
● ... the interface and integration point of Apache
CXF in JBoss application server
– AS 6.x, AS 7.x target containers
5. Reasons for integrating
● really good open source implementations
already available - NIH syndrome
● focus on added value
● ... a lot of Web Services specifications!
6.
7. Who benefits from this move
● The JBoss community:
– greater joint community support
– core devs can work on added value and
application server specific integration
● The integrated ws project and its community:
– additional tests
– bugs detection and fix
– ...
8. Why Apache CXF?
● tech analysis: features, quality of code, performances,
extensibility ...
● community size / activity
● opennes to participation / involvement
– commit rights
– support paths
– need for a deal?
● driving forces behind the project?
● future potential
Apache CXF perfectly fitted, others didn't...
9. A contribution balance
● JBoss -> Apache CXF community
– Java EE TCK6 testing
– Additional testing scenarios
– Multiple bug fixes
– Endpoint.publish() API additions in JAXWS 2.2
● Apache CXF community -> JBoss
– Quick time-to-market with JAXWS 2.2
– Many WS-* features, especially in the WS-Security
area
– Multiple bug fixes
– ...
10. Features
● Inherited from Apache CXF
– JAXWS 2.2
– WS-* (RM, Security, Policy, Addressing, ...)
● JBossWS Integration
– AS integration (authentication, authorization, ...)
– Additional API (e.g. @EndpointConfig)
– Tooling (Maven, Ant, ...)
– JSR109 1.3
– JAXBIntroductions
– Common JAX-WSA JSR-261 API
– Management (console, record system, ...)
11. Do I really need your integration
layer?
● Home-brew solutions for running CXF on JBoss
AS might work for specific usecases, but you...
– need to embed the stack in your apps
– will suffer from classloading issues
– can just use pojo endpoints
– have no webserviceref injection in ejb3
– loose additional JBossWS features
– ...
12. How it works - runtime
Request flow
WS-* ...
Endpoint servlet
RequestHandler
Invoker
JBoss
Apache CXF AS
JAX-WS
... handlers
Response flow
13. How it works - deployment
● POJO endpoint
@WebService(...) <web-app ...> [optional web.xml]
<servlet>
public class MyEndpoint { <servlet-name>TestService</servlet-name>
public String sayHello() { <servlet-class>org.jboss.test.ws.jaxws.samples.MyEndpoint</servlet-class>
return "Hello World!"; </servlet>
} <servlet-mapping>
} <servlet-name>TestService</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
● EJB3 endpoint ● Create metadata to
deploy jboss-web app
@WebService(...) ● Create CXF bus
@Stateless ● Customize CXF bus
public class MyEndpoint { ● Start web app for
public String sayHello() { published endpoints
return "Hello World!";
}
}
14. JBoss Application Server 7.1
● JavaEE 6 Full Profile compliant
● Fast and lighweight
● Domain management (DMR)
● Multiple management interfaces (CLI, API,
console)
● Modular classloading
● Standalone and Domain operational modes
● Arquillian support
15. JBossWS in AS 7
● webservices subsystem part of AS7 DMR
– wsdl soap:address rewrite
– pre-defined endpoint configs
● Modules
– org.jboss.ws.*
– org.jboss.as.webservices.*
– org.apache.cxf
– misc dependencies (Santuario, WSS4J, WSDL4J, etc.)
● Command line tools
– wsconsume.sh/bat, wsprovide.sh/bat
16. So, why JBossAS 7 for WS?
● Lightweight yet full JavaEE6 compliant container
● Fast start-up / easy development & testing
● Apache CXF integration
– Wide range of WS specs coverage
– Performances
● Peace of mind coming from
– “joint” JBoss / Apache CXF community
– Red Hat support if moving to Enterprise Platform