JBoss AS7 Webservices

14
+ JBoss Web Services Alessio Soldano [email protected] Principal Software Eng. JBoss - Red Hat September 20th, 2011

description

Alessio Soldano - JBug Milano - September 2011

Transcript of JBoss AS7 Webservices

Page 1: JBoss AS7 Webservices

+JBoss Web Services

Alessio [email protected]

Principal Software Eng.JBoss - Red Hat

September 20th, 2011

Page 2: JBoss AS7 Webservices

Who is Alessio?

● JBoss WS[1] committer since early 2007

● JBoss / Red Hat employee since end of 2007

● JBoss Web Service Lead, 2008

● JBoss AS[2], JBoss Wise[3] contributor

● Current Red Hat representative at JSR-224 EG and W3C WS-ResourceAccess WG

● Apache CXF[4] committer and PMC member

[1] http://www.jboss.org/jbossws [2] http://www.jboss.org/jbossas

[3] http://www.jboss.org/wise [4] http://cxf.apache.org

Page 3: JBoss AS7 Webservices

● AS7 services

● AS7 subsystems

●JBoss WS● Apache CXF integration● Features

●AS 7 Web Services extension● Model● Modules & classloading

JBoss Web Services

Page 4: JBoss AS7 Webservices

Services

● Almost everything is a service

● Services are objects that can be started and stopped

● Services can have dependencies on other services

● Services can't start before their dependencies are not satisfied

● Before stopping all dependent services will be stopped

● Services can inject dependent services

Page 5: JBoss AS7 Webservices

Service examples

● Of course core services, but also

– EJBs

– JNDI bindings

– Servlets

– Deployments

– Registries

● Individually shutdown and restart with all dependencies being maintained

– e.g. XTS endpoints

Page 6: JBoss AS7 Webservices

Subsystems

● A subsystem implements a “logical” area of the server

– subsystem:datasources

– subsystem:messaging

– subsystem:ejb3

– subsystem:webservices

● The subsystem can provide user visible configuration

– datasource definitions

– web connector configurations

Page 7: JBoss AS7 Webservices

Subsystems

● Custom subsystems can be implemented for functionality outside of the application server

● The subsystem consist of an extension

– org.jboss.as.controller.Extension

● Other components

– Schema

– Parsers

– OperationHandlers

● Example: org.jboss.as.webservices extension

– Model

– Modules

Page 8: JBoss AS7 Webservices

● “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 JBoss WS?

Page 9: JBoss AS7 Webservices

Apache CXF integration

● Standards & specifications

● NIH syndrome & wider community

● Added value

● Home-brew solutions for running CXF on JBossAS 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 Web Service Framework features ;-)

– ...

Page 10: JBoss AS7 Webservices

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

...

Page 11: JBoss AS7 Webservices

How it works - deployment

● POJO endpoint<web-app ...> <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

Page 12: JBoss AS7 Webservices

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>

Page 13: JBoss AS7 Webservices

Links

● WS documentation for AS7

– https://docs.jboss.org/author/display/JBWS

● http://www.jboss.org/jbossws

● http://jbossws.blogspot.com/

Page 14: JBoss AS7 Webservices

Thanks!

Q & A