developing webservice using rad 7.5[2.1]_done.doc

Upload: automationqtp123

Post on 02-Jun-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 Developing WebService using RAD 7.5[2.1]_done.doc

    1/38

    Developing Web Service using RAD 7.5 for WAS 6.1

    Developing Web Service using RAD 7.5 for WAS 6.1

    Status:

    Version: 2.1TCS Confiential

  • 8/10/2019 Developing WebService using RAD 7.5[2.1]_done.doc

    2/38

    Sub!ect "ast save on #age Version

    Developing Web Service using RAD 7.5 for WAS 6.1 17/11/21! 2/"# 2.1

    $ersion nu%ber R ev is ion && 1 .

    Date Date&& 17 nove%ber 21!

    Status Draft

    Aut'or Anirban (angul)

    Web Service using RAD 7.5 *e%plate $ersion& 1.

  • 8/10/2019 Developing WebService using RAD 7.5[2.1]_done.doc

    3/38

    Sub!ect "ast save on #age Version

    Developing Web Service using RAD 7.5 for WAS 6.1 17/11/21! "/"# 2.1

    Contributors*'e follo+ing persons contribute, to t'is ,ocu%ent&

    $a%e

    Anirban (angul)

    &'ternal()nternal Revie**'is ,ocu%ent re-uires t'e follo+ing ternal/0nternal Revie+s. Recor,s of t'e appropriate revie+s are file,in t'e ualit) section of t'e proect control ,ocu%entation.

    $a%e +unction

    Rag'u Warrier *3S S4 0nternet aning89aga :olavarapu *3S S4 0nternet aning8

    Docu%ent Reference )nfor%ation

    Version ,istor-

    $r Date Re%ars ( C,anges Status Aut,or

    Draftt Approve

    Web Service using RAD 7.5 *e%plate $ersion& 1.

  • 8/10/2019 Developing WebService using RAD 7.5[2.1]_done.doc

    4/38

    Sub!ect "ast save on #age Version

    Developing Web Service using RAD 7.5 for WAS 6.1 17/11/21! !/"# 2.1

    TA/"& 0+ C0$T&$TS

    1 09*R;D3*0;9.......................................................................................................................................52 W SR$03S.......................................................................................................................................6

    2.1 DEVELOPMENTAPPROACHES................................................................................................................................6

    2.2 TECHNOLOGIESUSED...........................................................................................................................................6

    2.3 CONSUMERSERVICE(CLIENT)..............................................................................................................................7

    2.4 TESTINGTOOLS.....................................................................................................................................................7

    " W SR$03 S09( RAD 7.5 =A R:3? S;A: 1.18...........................................................................#3.1 SCOPEOFTHEPROOFOFCONCEPT......................................................................................................................8

    3.2 CREATINGWEBSERVICESFROMAAVABEAN....................................................................................................!

    3.3 GENERATEDFILESINWEBSERVICE...................................................................................................................1"

    ! (9RA*09( *@ W SR$03 3;9S4R S;A: 1.18..............................................................17

    4.1 TESTAPPROACH1# TESTWITHWEBSERVICESE$PLORER................................................................................174.2 TESTAPPROACH2# GENERATECLIENTANDSAMPLE SP.................................................................................2%

    4.3 VIEWINTCP IP MONITOR..................................................................................................................................24

    5 W SR$03 S09( RAD 7.5 =A WS 2.? S;A: 1.28....................................................................26".1 SERVERSIDEGENERATEDCODE........................................................................................................................3%

    ".2 GENERATEDWSDL............................................................................................................................................3%

    5.2.1 WSDL (EmployeeInfoService.wsdl) with SO! 1.2 specific"tions............................................................#$

    5.2.2 WSDL (EmployeeInfo.wsdl) with SO! 1.1 specific"tions........................................................................#$

    5.2.# SO! %e&'est %esponse.......................................................................................................................... ..#1

    6 3;93S0;9........................................................................................................................................."!

    Web Service using RAD 7.5 *e%plate $ersion& 1.

  • 8/10/2019 Developing WebService using RAD 7.5[2.1]_done.doc

    5/38

    Sub!ect "ast save on #age Version

    Developing Web Service using RAD 7.5 for WAS 6.1 17/11/21! 5/"# 2.1

    1 )$TR0DCT)0$Web services are selfBcontaine, soft+are services t'at can be accesse, using si%ple protocols over anet+or. *'e) can also be ,escribe, using stan,ar, %ec'anis%s? an, t'ese ,escriptions can be publis'e,an, locate, using stan,ar, registries. Web services can perfor% a +i,e variet) of tass? ranging fro% si%plere-uestBrepl) to full business process interactions. sing tools lie Rational Application Developer RAD8?eisting resources can be epose, as Web services ver) easil).

    Web services in 23&& V1.4;ne of t'e %ain c'anges in %oving fro% =2 $1." to $1.! is t'e incorporation of Web services into t'eplatfor% stan,ar,. =2 $1.! provi,es support for Web services clients an, also allo+s Web services to bepublis'e,. *'e %ain tec'nologies in =2 $1.! t'at provi,e t'is support are as follo+s&

    2ava A#) for "base Re%ote #roceure Calls 82AR#C9& =ABR:3 provi,es an A:0 for Web

    services clients to invoe services using S;A: over @**:. 0t also ,efines stan,ar, %appings bet+een

    =ava classes an, 4 t)pes. S0A# *it, Attac,%ents A#) for 2ava 8SAA29 & Allo+s S;A: %essages to be %anipulate, fro% +it'in

    =ava co,e. *'e A:0 inclu,es classes to represent suc' concepts as S;A: envelopes t'e basicpacaging %ec'anis% +it'in S;A:8? S;A: faults t'e S;A: e-uivalent of =ava eceptions8? S;A:connections? an, attac'%ents to S;A: %essages.

    Web Services for 23&&& *'is specification ,eals +it' t'e ,eplo)%ent of Web Service clients an, Web

    services t'e%selves. n,er t'is specification? Web services can be i%ple%ente, using =avaeans orstateless session = s.

    2ava A#) for " Registries 82AR9& *'is A:0 ,eals +it' accessing 4 registr) servers? suc' as

    servers provi,ing DD0 functionalit).

    *'e specifications for Web services support in =2 $1.! are available at&'ttp&//ava.sun.co%/2ee/

    Web Service using RAD 7.5 *e%plate $ersion& 1.

  • 8/10/2019 Developing WebService using RAD 7.5[2.1]_done.doc

    6/38

    Sub!ect "ast save on #age Version

    Developing Web Service using RAD 7.5 for WAS 6.1 17/11/21! 6/"# 2.1

    3 W&/ S&RV)C&S

    3.1 Develop%ent Approac,es

    There are two general approaches to Web service development:top-downandbottom-up.

    In thetop-downapproach, a Web service is based on the Web service interface and XML types, defined in

    Web Services Description Language (WSDL) and XML Schema Definition (XSD) files. The developer first

    designs the implementation of the Web service by creating a WSDL file using the WSDL editor. The

    developer can then use the Web services wizard to create the Web service and skeleton Java classes to

    which the developer can add the required code. The developer then modifies the skeleton implementation to

    interface with the business logic.

    In thebottom-upapproach, a Web service is created based on the existing business logic in Java beans or

    EJB s. A WSDL file is generated to describe the resulting Web service interface. The bottom-up pattern is

    often used for exposing existing function as a Web service. It might be faster, and no XSD or WSDL design

    skills are needed. However, if complex objects (for example, Java collection types) are used, then the

    resulting WSDL might be hard to understand and less interoperable.

    The top-down approach allows for more control over the Web service interface and the XML types used, and

    is the recommended approach for developing new Web services.

    Rational Application Developer provides wizards for exposing a variety of resources as Web services. In this

    document we will describe the process tocreate a new web service from a simple Java Bean.

    The Web Service wizard assists us in creating a new Web Service from a simple Java class, configures it for

    deployment, and deploys the Web Service to a server. The server can be the WebSphere Application

    Server V6.1 Test Environment included with Rational Application Developer or another application server.

    3.3 Tec,nologies se

    *'e follo+ing core tec'nologies are use, for Web services&

    "tensible 4arup anguage 48 is t'e %arup language t'at un,erlies Web services. 4 is a genericlanguage t'at can be use, to ,escribe an) in, of content in a structure, +a)? separate, fro% itspresentation to a specific ,evice. All ele%ents of Web services use 4 etensivel)? inclu,ing 4na%espaces an, 4 sc'e%as.*'e specification for 4 is available at&'ttp&//+++.+".org/4/

    S0A#Si%ple ;bect Access :rotocol S;A:8 is a net+or? transport? an, progra%%ing language neutral protocolt'at allo+ a client to call a re%ote service. *'e %essage for%at is 4. S;A: is use, for all co%%unicationbet+een t'e service re-uester an, t'e service provi,er. *'e for%at of t'e in,ivi,ual S;A: %essages,epen,s on t'e specific ,etails of t'e service being use,.

    *'e specification for S;A: is available at&'ttp&//+++.+".org/*R/soap/

    Web Service using RAD 7.5 *e%plate $ersion& 1.

    http://www.w3.org/XML/http://www.w3.org/TR/soap/http://www.w3.org/XML/http://www.w3.org/TR/soap/
  • 8/10/2019 Developing WebService using RAD 7.5[2.1]_done.doc

    7/38

    Sub!ect "ast save on #age Version

    Developing Web Service using RAD 7.5 for WAS 6.1 17/11/21! 7/"# 2.1

    WSD"Web Services Description anguage WSD8 is an 4Bbase, interface an, i%ple%entation ,escription

    language. *'e service provi,er uses a WSD ,ocu%ent in or,er to specif)& operations a Web service provi,es

    para%eters an, ,ata t)pes of t'ese operations

    service access infor%ation

    WSD is one +a) to %ae service interface an, i%ple%entation infor%ation available in a DD0 registr). Aserver can use a WSD ,ocu%ent to ,eplo) a Web Service. A service re-uester can use a WSD ,ocu%entto +or out 'o+ to access a Web Service or a tool can be use, for t'is purpose8.*'e specification for WSD is available at&'ttp&//+++.+".org/*R/+s,l/

    3. Consu%er Service 8Client9

    To assist in development of Web service clients, RAD provides the following features:

    Java client proxy from WSDL: The Web Service client wizard assists us in generating a proxy

    JavaBean. This proxy can be used within a client application to greatly simplify the client programming

    required to access a Web Service.

    Sample Web application from WSDL: Rational Application Developer can generate a sample

    Web application, which includes the proxy classes described above, and sample JSP s that use the

    proxy classes.

    3.4 Testing Tools

    To allow developers to test Web services, RAD provides a range of features:

    WebSphere Application Server V6.1, V6.0 and V5.1Test Environment: These Test Environments are

    included with Rational Application Developer as a test server and can be used to host Web services. It

    provides a range of Web services runtimes, including an implementation of the J2EE specification standards.

    Sample JSP application: The sample Web application mentioned in Section 2.3 can be used to test

    Web services and the generated proxy it uses.

    Web Services Explorer: This is a simple test environment that can be used to test any Web Service,

    based only on the WSDL file for the service. The service can be running on a local test server or anywhere

    else on the network.

    Universal Test Client: The Universal Test Client (UTC) is a very powerful and flexible test application

    that is normally used for testing EJBs. Its flexibility makes it possible to test ordinary Java classes, so it can

    be used to test the generated proxy classes created to simplify client development.

    TCP/P !onitor: The TCP/IP Monitor works like a proxy server, passing TCP/IP requests on to another

    server and directing the returned responses back to the originating client. In the process of doing this, it

    records the TCP/IP messages that are exchanged, and can display these in a special view within Rational

    Application Developer.

    Web Service using RAD 7.5 *e%plate $ersion& 1.

    http://www.w3.org/TR/wsdl/http://www.w3.org/TR/wsdl/
  • 8/10/2019 Developing WebService using RAD 7.5[2.1]_done.doc

    8/38

    Sub!ect "ast save on #age Version

    Developing Web Service using RAD 7.5 for WAS 6.1 17/11/21! #/"# 2.1

    Web Service using RAD 7.5 *e%plate $ersion& 1.

  • 8/10/2019 Developing WebService using RAD 7.5[2.1]_done.doc

    9/38

    Sub!ect "ast save on #age Version

    Developing Web Service using RAD 7.5 for WAS 6.1 17/11/21! C/"# 2.1

    W&/ S&RV)C& S)$; RAD 7.5 82A R#C< S0A# 1.19

    .1 Scope of t,e #roof of Concept

    0n t'is section +e ai% to ,evelop a si%ple +eb service using t'e botto% up approac' +'erein +e use asi%ple =ava ean to ,evelop a +eb service along +it' a test client an, ,eplo) t'e sa%e on a Websp'ere$6.1 application server. *'e goal of t'e :;3 is to provi,e a secure feeling on t'e ,evelop%ent an,,eplo)%ent of +eb services application using t'e ne+ AA infrastructure as part of WAS 6.1 %igration using=A R:3 +eb services runti%e environ%ent +'ic' uses S;A: 1.1.

    *'e +eb services application co%prises of " proects

    1. An AR proect SampleWebService +'ic' contains t'e belo+ %ention +eb proects2. A D)na%ic Web :roectMyWSWebModule+'ic' acts as t'e server si,e Web Service8

    ". A D)na%ic Web :roectMyWSWebClient+'ic' acts as t'e client to access t'e Web Service.

    *'e AR is ,eplo)e, on a Websp'ere Application Server $6.1 environ%ent.

    A preBre-uisite for t'e support of Web Services on RAD 7.5 an, ,eplo)%ent on t'e local WebSp'ereApplication Server 6.18 is t'e installation of t'e WebSp,ere 6.1 +eature #ac for Web Services.

    Web Service using RAD 7.5 *e%plate $ersion& 1.

  • 8/10/2019 Developing WebService using RAD 7.5[2.1]_done.doc

    10/38

    Sub!ect "ast save on #age Version

    Developing Web Service using RAD 7.5 for WAS 6.1 17/11/21! 1/"# 2.1

    .3 Creating Web Services fro% a 2ava /ean

    Step =13reate t'e AR proect SampleWebService an, t'e 2 D)na%ic Web :roects MyWSWebModuleMyWSWebClientin RAD 7.5 using t'e follo+ing lin?Eile B> 9e+ B> :roect B> =ava B> nterprise Application :roectEile B> 9e+ B> :roect B> Web B> D)na%ic Web :roect

    Step =3A,, t'e 2 %o,ules +eb proects8 to t'e AR.

    Step =3reate a ne+ =ava ean EmployeeInfo.javain MyWSWebModuleun,er t'e follo+ing pacagecom.abnamro.nl.employee

    Web Service using RAD 7.5 *e%plate $ersion& 1.

  • 8/10/2019 Developing WebService using RAD 7.5[2.1]_done.doc

    11/38

    Sub!ect "ast save on #age Version

    Developing Web Service using RAD 7.5 for WAS 6.1 17/11/21! 11/"# 2.1

    9ote t'e follo+ing co,e etract?

    publicEmployeeCustomDTO readEmployeeDetails(String employeeId) {

    EmployeeCustomDTO empResultDTO = null;

    empResultDTO = getEmployeeInfo(employeeId);

    returnempResultDTO;

    }

    0n t'is +eb service +e are eposing t'e operation readEmployeeDetails() +'ic' enables t'e client to t'is

    +eb service to retrieve t'e e%plo)ee ,etails of an e%plo)ee containe, in t'e output obectEmployeeCustomDT8 using an input string? %plo)ee 0,.

    *'e %plo)ee 3usto% D*; 'as t'e follo+ing attributes?privateString empame= null; !!Employee ame

    privateString empDesignation= null; !!Employee Designation

    privateString empE"perien#e= null; !!Employee E"perien#e

    privateString emp$ddress= null; !!Employee $ddress

    privateintempConta#t= %; !!Employee Conta#t

    privateString empS&ill= null; !!Employee S&ill

    privatebooleanisEmployee= false; !!Employee e"ists in t'e system

    privateString empID= null; !!Employee ID

    *'e usiness logic currentl) resi,es in t'e private %et'o, !etEmployeeInfo() . 3urrentl) t'e business logic

    states t'at ,ata can be retrieve, for onl) one user +it' e%plo)ee i, 1"7!"1. *'e private %et'o, is basicall)t'e entr) point to t'e application logic tier follo+e, b) business tier finall) t'e 0S tier. @o+ever t'e

    Web Service using RAD 7.5 *e%plate $ersion& 1.

  • 8/10/2019 Developing WebService using RAD 7.5[2.1]_done.doc

    12/38

    Sub!ect "ast save on #age Version

    Developing Web Service using RAD 7.5 for WAS 6.1 17/11/21! 12/"# 2.1

    i%ple%entation for t'e sa%e is outsi,e t'e scope for t'is :;3. We +ill onl) concentrate on ,eveloping a+eb service +it' ,u%%) business logic.

    Step =4*o create t'e Web Service fro% t'e =ava ean perfor% t'e follo+ing?Rig't clic on EmployeeInfo.java an, select Web services ->Create Web service.*'e Web Service +iFar, starts

    Select the Web Services options in the Web Services page:

    Select"ottom #p Java bean Web service as your Web service type.

    This should be selected by default.

    Ensure that the following server-side configurations are selected:

    Server: WebSphere v6.1 Server

    Web service runtime: IBM WebSphere JAX-RPC

    Service project:MyWSWebModule

    Service EAR project:SampleWebService

    Web Service using RAD 7.5 *e%plate $ersion& 1.

  • 8/10/2019 Developing WebService using RAD 7.5[2.1]_done.doc

    13/38

    Sub!ect "ast save on #age Version

    Developing Web Service using RAD 7.5 for WAS 6.1 17/11/21! 1"/"# 2.1

    Step =5

    If you click the hyperlinkServer$ WebSphere v%&' Server, the Service Deployment Configuration

    dialog is displayed as shown below,

    This page allows you to select the server and runtime. We select the recommended Web service runtime to

    use within Rational Application Developer which is the WebSphere JAX-RPC Web services runtime.

    Axis runtime shipped with Application Developer v7 (Axis v1.3) is a J2SE SOAP engine and it supports the

    JAX-RPC standard. It does not require a J2EE container.

    The WebSphere JAX-RPC Web service runtime is derived from Apache Axis, but has diverged and contains

    many enhancements, such as improved performance, WS-Security, multi-protocol support, J2EE

    compliance, in-process optimization, compression, smart parsing, and other enhancements.

    ClearP#blish the Web service (we do not publish to a UDDI registry) and

    Click(ext in the Web Services page.

    Web Service using RAD 7.5 *e%plate $ersion& 1.

  • 8/10/2019 Developing WebService using RAD 7.5[2.1]_done.doc

    14/38

    Sub!ect "ast save on #age Version

    Developing Web Service using RAD 7.5 for WAS 6.1 17/11/21! 1!/"# 2.1

    Step =6

    In the Service Endpoint Interface Selection dialog, accept the default settings and click(ext

    Web services %ust co%pl) +it' t'e WSB0 basic profile version 1.1.

    Step =7

    In the Web Service dialog, accept the default options and click(ext

    ;n clicing t'e 9et button? t'e WSD file %plo)ee0nfo.+s,l is create, an, t'e %et'o,rea,%plo)eeDetails8 is t'e operation epose, b) t'e service.

    Web Service using RAD 7.5 *e%plate $ersion& 1.

  • 8/10/2019 Developing WebService using RAD 7.5[2.1]_done.doc

    15/38

    Sub!ect "ast save on #age Version

    Developing Web Service using RAD 7.5 for WAS 6.1 17/11/21! 15/"# 2.1

    Web Service using RAD 7.5 *e%plate $ersion& 1.

  • 8/10/2019 Developing WebService using RAD 7.5[2.1]_done.doc

    16/38

    Sub!ect "ast save on #age Version

    Developing Web Service using RAD 7.5 for WAS 6.1 17/11/21! 16/"# 2.1

    Step =>

    ClickStart Server. It takes a while to start the server. After the server is started, click(ext or Cancel&

    Eor our un,erstan,ing purpose? +e stop t'e server an, scan t'roug' t'e ,irector) structure ofMyWSWebModuleproect in t'e follo+ing section.

    Web Service using RAD 7.5 *e%plate $ersion& 1.

  • 8/10/2019 Developing WebService using RAD 7.5[2.1]_done.doc

    17/38

    Sub!ect "ast save on #age Version

    Developing Web Service using RAD 7.5 for WAS 6.1 17/11/21! 17/"# 2.1

    . ;enerate +iles in Web Service

    *'e WSD for t'e +eb service is create, at t'e follo+ing pat'?4)WSWeb4o,ule B> Web3ontent B> WB09E B> +s,l B> %plo)ee0nfo.+s,l

    *'e +eb service location is %entione, in t'e create, WSD file?

    sdlsoap*addresslo#ation="http://localhost:9080/MyWSWebModule/services/EmployeeInfo" !+

    This WSDL is used by the application server for deployment purposes, and is accessible to external clients

    through HTTP.

    The wizard generates a number of files which are discussed below. Since the original Java classes are

    located in theMyWSWebModuleproject, all of the generated code is located in the same project.

    Theservice en)point interface *EmployeeInfo_SEI.java+ is the Java interface that is

    implemented by the Web Service. This will include a subset of the public methods on the class that

    haves been exposed in the Web service.

    Web Service using RAD 7.5 *e%plate $ersion& 1.

  • 8/10/2019 Developing WebService using RAD 7.5[2.1]_done.doc

    18/38

  • 8/10/2019 Developing WebService using RAD 7.5[2.1]_done.doc

    19/38

    Sub!ect "ast save on #age Version

    Developing Web Service using RAD 7.5 for WAS 6.1 17/11/21! 1C/"# 2.1

    4 ;&$&RAT)$; T?& W&/ S&RV)C& C0$S&R 8S0A# 1.19

    4.1 Test Approac, 1: Test *it, Web Services &'plorer

    3lic on t'e follo+ing lin? %plo)ee0nfo.+s,l in 4)WSWeb4o,ule8 B> Web Services B> *est +it' WebServices plorer

    *'e follo+ing screen applies?

    Web Service using RAD 7.5 *e%plate $ersion& 1.

  • 8/10/2019 Developing WebService using RAD 7.5[2.1]_done.doc

    20/38

    Sub!ect "ast save on #age Version

    Developing Web Service using RAD 7.5 for WAS 6.1 17/11/21! 2/"# 2.1

    9ote t'e follo+ing in t'e above *est 3lient interface?*'e Web Service en, point is& http://localhost:9082/MyWSWebModule/services/EmployeeInfo

    *'e supporte, operation is readEmployeeDetails 8.3lic on t'e operation to perfor% t'e test an, specif) input employeeIdpara%eter. nsure t'at t'eapplication server is starte,.

    Eollo+ing is t'e response fro% t'e +eb service?

    Web Service using RAD 7.5 *e%plate $ersion& 1.

  • 8/10/2019 Developing WebService using RAD 7.5[2.1]_done.doc

    21/38

    Sub!ect "ast save on #age Version

    Developing Web Service using RAD 7.5 for WAS 6.1 17/11/21! 21/"# 2.1

    *'e S;A: Re-uest nvelope sent fro% client to server8 is?

    -

    -

    -

    13!31

    *'e S;A: Response envelope receive, fro% server to client8 is?

    -

  • 8/10/2019 Developing WebService using RAD 7.5[2.1]_done.doc

    22/38

    Sub!ect "ast save on #age Version

    Developing Web Service using RAD 7.5 for WAS 6.1 17/11/21! 22/"# 2.1

    4.3 Test Approac, 3: ;enerate Client an Sa%ple 2S#

    0n or,er to generate t'e client si,e pro) classes? select t'e follo+ing lin?

    Rig't 3lic on %plo)ee0nfo.+s,l B> Web Services B> (enerate 3lient

    *'e follo+ing +iFar, appears?

    3lient on t'e 3lient :roect lin an, up,ate t'e client proect to? MyWSWebClient.3lic on $e'tbutton to navigate to t'e screen s'o+n belo+.

    Web Service using RAD 7.5 *e%plate $ersion& 1.

  • 8/10/2019 Developing WebService using RAD 7.5[2.1]_done.doc

    23/38

    Sub!ect "ast save on #age Version

    Developing Web Service using RAD 7.5 for WAS 6.1 17/11/21! 2"/"# 2.1

    Select t'e output fol,er as MyWSWebClient"srcan, t'e pacage na%e as com.abnamro.nl.employee .3lic on t'e +inis,button to generate t'e client.

    0n or,er to generate sa%ple =S: s for testing t'e application ,o t'e follo+ing?Rig't 3lic on co%.abna%ro.nl.a%plo)ee.%plo)ee0nfo:ro).ava B> Web Services B> (enerate 3lient

    Web Service using RAD 7.5 *e%plate $ersion& 1.

  • 8/10/2019 Developing WebService using RAD 7.5[2.1]_done.doc

    24/38

    Sub!ect "ast save on #age Version

    Developing Web Service using RAD 7.5 for WAS 6.1 17/11/21! 2!/"# 2.1

    *'e follo+ing sa%ple =S: s are create, in 4)WSWeb3lient B> Web3ontent B> sa%ple%plo)ee0nfo:ro)

    *'e +eb service application can no+ be teste, b) starting up t'e application server an, e)ing in t'efollo+ing R on t'e bro+ser?

    Web Service using RAD 7.5 *e%plate $ersion& 1.

  • 8/10/2019 Developing WebService using RAD 7.5[2.1]_done.doc

    25/38

    Sub!ect "ast save on #age Version

    Developing Web Service using RAD 7.5 for WAS 6.1 17/11/21! 25/"# 2.1

    Descriptor output is s'o+n belo+ on clicing t'e )nvoebutton?

    Rea, %plo)ee Details output is s'o+n belo+ on clicing t'e )nvoebutton?

    Web Service using RAD 7.5 *e%plate $ersion& 1.

  • 8/10/2019 Developing WebService using RAD 7.5[2.1]_done.doc

    26/38

    Sub!ect "ast save on #age Version

    Developing Web Service using RAD 7.5 for WAS 6.1 17/11/21! 26/"# 2.1

    4. Vie* in TC# )# onitor

    *'e *3:/0: 4onitor is also starte,. *'e *3:/0: 4onitor lets us intercept an, ea%ine t'e S;A: trafficco%ing in an, out of a Web service.0f )ou invoe t'e getEndpoint%et'o, in t'e Sa%ple =S: page gives us t'e follo+ing R'ttp&//local'ost&C#2/4)WSWeb4o,ule/services/%plo)ee0nfo

    *'e port nu%ber for *3: 0: is 6CC5 +'ic' can be verifie, t'roug' t'e follo+ing lin?Wino* @ #references @ Run(Debug @ TC#()# onitorW'en t'e *3:/0: 4onitor is starte, it is rea,) to listen to t'e S;A: re-uest at port 6CC5 an, t'e traffic getsre,irecte, to t'e *3: 0: console +it' t'e follo+ing en, point?'ttp&//local'ost&6CC5/4)WSWeb4o,ule/services/%plo)ee0nfo

    Also of significance is t'at +e are using @**: :;S* %et'o, for t'e re-uest an, @**: version is 1.1.*'is is ,eter%ine, fro% t'e follo+ing in t'e screens'ot above? alternative is to use Eirefo8@ea,er& :;S*/4)WSWeb4o,ule/services/%plo)ee0nfo @**: 1.1

    *o learn %ore about t'e e) ,ifference bet+een @**: 1. @**: 1.1 please refer to t'e follo+ing lins? 'ttp&//+++.researc'.att.co%/Gbala/papers/'v'1.'t%l

    'ttp&//+++.+".org/:rotocols/rfc2616/rfc2616Bsec#.'t%l

    Web Service using RAD 7.5 *e%plate $ersion& 1.

  • 8/10/2019 Developing WebService using RAD 7.5[2.1]_done.doc

    27/38

    Sub!ect "ast save on #age Version

    Developing Web Service using RAD 7.5 for WAS 6.1 17/11/21! 27/"# 2.1

    *'e follo+ing ea%ple is a sa%ple of S;A: 1.1 re-uest an, response.

    S0A# Reuest

    1"7!"11Anirban (angul)0*A6 JearsJantra :ar? *'ane

    1111=A$A / =2

  • 8/10/2019 Developing WebService using RAD 7.5[2.1]_done.doc

    28/38

    Sub!ect "ast save on #age Version

    Developing Web Service using RAD 7.5 for WAS 6.1 17/11/21! 2#/"# 2.1

    5 W&/ S&RV)C& S)$; RAD 7.5 82A WS 3.=< S0A# 1.390n t'is section +e ai% to ,evelop a si%ple +eb service using t'e botto% up approac' +'erein +e use asi%ple =ava ean to ,evelop a +eb service along +it' a test client an, ,eplo) t'e sa%e on a WebSp'ere$6.1 application server. *'e goal of t'e :;3 is to provi,e a secure feeling on t'e ,evelop%ent an,,eplo)%ent of +eb services application using t'e ne+ AA infrastructure as part of WAS 6.1 %igration using=A WS 2. +eb services runti%e environ%ent using S;A: 1.2.

    This section includes the following tasks:

    Installing the Web Services Feature Pack (click onChec5 for #p)ates on the Install page of the

    Installing Packages wizard in IBM Installation Manager)

    Enabling the WAS V6.1 test environment with the Feature Pack for Web Services

    Creating a Web service and a client using the JAX-WS runtime

    Sending binary data using MTOM

    *'e +eb services application co%prises of " proects as in t'e earlier ea%ple

    !. An AR proect SampleWebServiceS#$%& +'ic' contains t'e belo+ %ention +eb proects5. A D)na%ic Web :roectMyWSWebModuleS#$%&+'ic' acts as t'e server si,e Web Service86. A D)na%ic Web :roectMyWSWebClientS#$%&+'ic' acts as t'e client to access t'e Web Service.

    *'e AR is ,eplo)e, on a WebSp'ere Application Server $6.1 environ%ent server is 'ig'lig'te,8.

    Web Service using RAD 7.5 *e%plate $ersion& 1.

  • 8/10/2019 Developing WebService using RAD 7.5[2.1]_done.doc

    29/38

    Sub!ect "ast save on #age Version

    Developing Web Service using RAD 7.5 for WAS 6.1 17/11/21! 2C/"# 2.1

    *'e sa%e EmployeeInfobean is reuse, in t'is ea%ple. *'e subse-uent sli,es s'o+ t'e creation of t'e +ebservice WSD file server si,e pro) classes. *o generate t'e sa%e +e nee, to follo+ t'e follo+ing lin?

    Rig't clic on %plo)ee0nfo bean +it'inMyWSWebModuleS#$%&proect B> Web Services B> 3reate Webservice. Select t'e WebSp'ere $6.1 server +'ere )ou +is' to ,eplo) t'e +eb service an, t'e runti%eenviron%ent is 04 WebSp'ere =A WS.

    Web Service using RAD 7.5 *e%plate $ersion& 1.

  • 8/10/2019 Developing WebService using RAD 7.5[2.1]_done.doc

    30/38

    Sub!ect "ast save on #age Version

    Developing Web Service using RAD 7.5 for WAS 6.1 17/11/21! "/"# 2.1

    Web Service using RAD 7.5 *e%plate $ersion& 1.

  • 8/10/2019 Developing WebService using RAD 7.5[2.1]_done.doc

    31/38

    Sub!ect "ast save on #age Version

    Developing Web Service using RAD 7.5 for WAS 6.1 17/11/21! "1/"# 2.1

    *'e S;A: 1.2 in,ing specification is set in t'e +iFar, as s'o+n in t'e screen belo+.

    Case 1:*'e =A$A to WSD %apping st)le is set to R:3.

    Case 3: *'e =A$A to WSD %apping st)le is set to Docu%ent Wrappe, an, 4*;4 Support is enable,.

    Web Service using RAD 7.5 *e%plate $ersion& 1.

  • 8/10/2019 Developing WebService using RAD 7.5[2.1]_done.doc

    32/38

    Sub!ect "ast save on #age Version

    Developing Web Service using RAD 7.5 for WAS 6.1 17/11/21! "2/"# 2.1

    9et +e procee, to starting t'e server an, testing t'e application after creating t'e client via nor%alproce,ure as %entione, in t'e earlier section.

    Web Service using RAD 7.5 *e%plate $ersion& 1.

  • 8/10/2019 Developing WebService using RAD 7.5[2.1]_done.doc

    33/38

    Sub!ect "ast save on #age Version

    Developing Web Service using RAD 7.5 for WAS 6.1 17/11/21! ""/"# 2.1

    5.1 Server Sie ;enerate Coe

    *'e server si,e class EmployeeInfoDele!ate.java 'as t'e follo+ing entr)? S;A: 1.2 specification8

    Case 1:0f =A$A to WSD %apping is R:3?

    ,-a.a"/-s/0e1Ser.i#e(targetamespa#e=2'ttp*!!employee/nl/a1namro/#om!2 3

    ser.i#eame=2EmployeeInfoSer.i#e23 portame=2EmployeeInfo4ort23

    sdl5o#ation=20E67I8!sdl!EmployeeInfoSer.i#e/sdl2 )

    ,-a.a"/"ml/s/6indingType

    (.alue=-a.a"/"ml/s/soap/SO$46inding/ S!#2$%%&'I()I(*),-a.a"/-s/soap/SO$46inding(style = -a.a"/-s/soap/SO$46inding/Style/+,)

    0'ere3

    public static final ava.lang.String S;A:12@**:K09D09( H I'ttp&//+++.+".org/2"/5/soap/bin,ings/@**:/IL

    Case 3:0f =A$A to WSD %apping is Docu%ent Wrappe,?

    ,-a.a"/-s/0e1Ser.i#e(targetamespa#e=2'ttp*!!employee/nl/a1namro/#om!2 3

    ser.i#eame=2EmployeeInfoSer.i#e23 portame=2EmployeeInfo4ort23

    sdl5o#ation=20E67I8!sdl!EmployeeInfoSer.i#e/sdl2 )

    ,-a.a"/"ml/s/6indingType

    (.alue=-a.a"/"ml/s/soap/SO$46inding/ S!#2$%%&M%M&'I()I(*)

    0'ere3

    public static final ava.lang.String S;A:12@**:K4*;4K09D09( H I'ttp&//+++.+".org/2"/5/soap/bin,ings/@**:/M%to%HtrueIL

    5.3 ;enerate WSD"

    Also note+ort') is t'e follo+ing ,ifference?

    5.3.1 WSD" 8EmployeeInfoService.wsdl9 *it, S0A# 1.3 specifications

    9"ml .ersion="#-0"en#oding=".%8"9+definitions name="EmployeeInfoService"targetamespa#e="http://employee-nl-abnamro-com/" "mlns="http://schemas-1mlsoap-or/3sdl/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"

    "mlns*tns="http://employee-nl-abnamro-com/" "mlns*"sd="http://333-34-or/200#/5M6Schema" +

    Case 1:0f =A$A to WSD %apping is R:3?soap:*1indingstyle="rpc"transport="http://333-34-or/2004/07/soap/bindins/$%%/" !+

    Case 3:0f =A$A to WSD %apping is Docu%ent Wrappe,?soap:*1indingstyle="document"transport="http://333-34-or/2004/07/soap/bindins/$%%/" !+

    5.3.3 WSD" 8EmployeeInfo.wsdl9 *it, S0A# 1.1 specifications

    9"ml .ersion="#-0"en#oding=".%8"9+sdl*definitions targetamespa#e="http://employee-nl-abnamro-com" "mlns*impl="http://employee-nl-abnamro-com"

    Web Service using RAD 7.5 *e%plate $ersion& 1.

  • 8/10/2019 Developing WebService using RAD 7.5[2.1]_done.doc

    34/38

    Sub!ect "ast save on #age Version

    Developing Web Service using RAD 7.5 for WAS 6.1 17/11/21! "!/"# 2.1

    "mlns*intf="http://employee-nl-abnamro-com" "mlns*sdl="http://schemas-1mlsoap-or/3sdl/"

    xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" "mlns*"sd="http://333-34-or/200#/5M6Schema" +

    sdlsoap*1indingstyle="document"transport="http://schemas-1mlsoap-or/soap/http" !+

    5.3. S0A# Reuest Response

    Eollo+ing is t'e test screen for t'e Web Service?

    *'e *3: 0: 4onitor +'ere t'e S;A: re-uest response is trappe, is s'o+n belo+?

    Web Service using RAD 7.5 *e%plate $ersion& 1.

  • 8/10/2019 Developing WebService using RAD 7.5[2.1]_done.doc

    35/38

    Sub!ect "ast save on #age Version

    Developing Web Service using RAD 7.5 for WAS 6.1 17/11/21! "5/"# 2.1

    5.3..1 S0A# 1.3 reuest an response 8R#C9

    S0A# Reuest

    1"7!"1

    S0A# Reponse

    Jantra :ar? *'ane11110*A6 Jears1"7!"1Anirban (angul)=A$A / =2

    true

    5.3..3 S0A# 1.3 reuest an response 8Docu%ent Wrappe *it, T09

    S0A# Reuest

    1"7!"1

    S0A# Response

    BB404oun,ar)urnKuui,KD!DEDE7A23633A212!#2!C"2772contentBt)pe& application/opN%lL c'arsetH*EB#L t)peHIapplication/soapN%lIcontentBtransferBenco,ing& binar)contentBi,&

    Web Service using RAD 7.5 *e%plate $ersion& 1.

  • 8/10/2019 Developing WebService using RAD 7.5[2.1]_done.doc

    36/38

    Sub!ect "ast save on #age Version

    Developing Web Service using RAD 7.5 for WAS 6.1 17/11/21! "6/"# 2.1

  • 8/10/2019 Developing WebService using RAD 7.5[2.1]_done.doc

    37/38

  • 8/10/2019 Developing WebService using RAD 7.5[2.1]_done.doc

    38/38

    Sub!ect "ast save on #age Version

    Developing Web Service using RAD 7.5 for WAS 6.1 17/11/21! "#/"# 2.1

    Stan,ar, an, %ost efficient co%pare, to enco,e, for%ats8 solution

    Supporte, b) WSBSecurit) solutions

    Supporte, b) =ABWS

    Eor a ,etaile, overvie+ of t'e ,ifferences bet+een S;A: 1.1 S;A: 1.2 specifications please refer?'ttp&//'a,le)net.org/%arc/+'atsne+.'t%l

    *'e ,ocu%ent ai%s to provi,e confi,ence in ,eveloping Web Services using RAD 7.5 +it' ,ifferent runti%eenviron%ents an, gui,es a ,eveloper +it' a step b) step approac' for t'e sa%e.

    http://hadleynet.org/marc/whatsnew.htmlhttp://hadleynet.org/marc/whatsnew.html