As7 web services - JUG Milan April 2012
-
Upload
alepalin -
Category
Technology
-
view
1.507 -
download
4
description
Transcript of As7 web services - JUG Milan April 2012
Web ServicesWeb Services
Alessio [email protected]
Principal Software Eng.JBoss - Red Hat
April 12th, 2012
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
● What is JBoss WS ?
● Apache CXF integration
● Features
● JBoss AS 7.1
● Key features
● WS components
● Demo
Agenda
● “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
What is JBossWS?
Reasons for integrating
● really good open source implementations already available - NIH syndrome
● focus on added value
● ... a lot of Web Services specifications!
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
– ...
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...
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
– ...
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, ...)
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
– ...
How it works - runtime
Re
qu
estH
and
ler
Inv
oke
r
En
dp
oin
t servle
t
Apache CXF
Request flow
Response flow
JBossAS
...
WS-*
JAX-WShandlers
...
How it works - deployment
● POJO endpoint<web-app ...> [optional web.xml] <servlet> <servlet-name>TestService</servlet-name> <servlet-class>org.jboss.test.ws.jaxws.samples.MyEndpoint</servlet-class> </servlet> <servlet-mapping> <servlet-name>TestService</servlet-name> <url-pattern>/*</url-pattern> </servlet-mapping></web-app>
● EJB3 endpoint
@WebService(...)public class MyEndpoint { public String sayHello() { return "Hello World!"; }}
@WebService(...)@Statelesspublic class MyEndpoint { public String sayHello() { return "Hello World!"; }}
● Create metadata todeploy jboss-web app● Create CXF bus● Customize CXF bus● Start web app for published endpoints
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
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
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
Demo
● Basic WS endpoint deployment
– AS7 console
● WS-Security UT Profile JAAS integration
– Policy driven approach
– AS7 / CXF security integration<subsystem xmlns="urn:jboss:domain:security:1.1"> <security-domains> <!-- ... other security domains ... --> <security-domain name="JBossWS"> <authentication> <login-module code="UsersRoles" flag="required"> <module-option name="usersProperties" value="jbossws-users.properties"/> <module-option name="unauthenticatedIdentity" value="anonymous"/> <module-option name="rolesProperties" value="jbossws-roles.properties"/> </login-module> </authentication> </security-domain> </security-domains> </subsystem>
Demo -> OpenShift
● WS-Security interoperability endpoints– http://jbossws.blogspot.it/2012/04/ws-endpoints-on-openshift.html
● Try it!
– http://jbossws-asoldano.rhcloud.com/jbossws-cxf-wsse-interop
● Read some doc ;-)
– https://docs.jboss.org/author/display/JBWS/WS-Security
● Clone the repo!
– https://github.com/asoldano/jbossws-cxf-wsse-interop-openshift
● Look at the webapp sources
– http://anonsvn.jboss.org/repos/jbossws/projects/interop/cxf/wsse-webapp/ (webapp)
– http://download.jboss.org/jbossws/jbossws-cxf-4.0.2.GA.zip (endpoints)
Links
● AS 7.1 documentation (WS and anything)
– https://docs.jboss.org/author/display/JBWS
– https://docs.jboss.org/author/display/AS71/
● http://www.jboss.org/jbossws
● http://www.jboss.org/jbossas
● http://jbossws.blogspot.com/
Thanks!
Q & A