As7 web services - JUG Milan April 2012

20
Web Services Web Services Alessio Soldano [email protected] Principal Software Eng. JBoss - Red Hat April 12th, 2012

description

 

Transcript of As7 web services - JUG Milan April 2012

Page 1: As7 web services - JUG Milan April 2012

Web ServicesWeb Services

Alessio [email protected]

Principal Software Eng.JBoss - Red Hat

April 12th, 2012

Page 2: As7 web services - JUG Milan April 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

Page 3: As7 web services - JUG Milan April 2012

● What is JBoss WS ?

● Apache CXF integration

● Features

● JBoss AS 7.1

● Key features

● WS components

● Demo

Agenda

Page 4: As7 web services - JUG Milan April 2012

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

Page 5: As7 web services - JUG Milan April 2012

Reasons for integrating

● really good open source implementations already available - NIH syndrome

● focus on added value

● ... a lot of Web Services specifications!

Page 6: As7 web services - JUG Milan April 2012
Page 7: As7 web services - JUG Milan April 2012

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

– ...

Page 8: As7 web services - JUG Milan April 2012

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...

Page 9: As7 web services - JUG Milan April 2012

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

– ...

Page 10: As7 web services - JUG Milan April 2012

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, ...)

Page 11: As7 web services - JUG Milan April 2012

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

– ...

Page 12: As7 web services - JUG Milan April 2012

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 13: As7 web services - JUG Milan April 2012

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

Page 14: As7 web services - JUG Milan April 2012

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

Page 15: As7 web services - JUG Milan April 2012

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

Page 16: As7 web services - JUG Milan April 2012

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

Page 17: As7 web services - JUG Milan April 2012

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 18: As7 web services - JUG Milan April 2012

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)

Page 19: As7 web services - JUG Milan April 2012

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/

Page 20: As7 web services - JUG Milan April 2012

Thanks!

Q & A