You are on page 1of 27

Web Serv|ce Web Serv|ce

Monlruzzaman 8hulyan
lnsLlLuLe of lnformaLlon 1echnology
unlverslLy of uhaka
mb[duacbd
wwwLlnyurlcom/monlrb
What |s th|s? What |s th|s?
W Jeb Servlces can converL your appllcaLlon
lnLo a JebappllcaLlon whlch can publlsh
lLs funcLlon or message Lo Lhe resL of Lhe
world
W 1he baslc Jeb Servlces plaLform ls xML +
P11
mb[duacbd | wwwLlnyurlcom/monlrb
re re
W Loosely coupled reusable sofLware
componenLs LhaL semanLlcally encapsulaLe
dlscreLe funcLlonallLy and are dlsLrlbuLed
and programmaLlcally accesslble over
sLandard lnLerneL proLocols
W emoLe
9rocedure
alllng proLocol
LhaL works over @@9
mb[duacbd | wwwLlnyurlcom/monlrb
exaes exaes
W eLrleve lnformaLlon dynamlcally over web
Servlce lnLegraLlons
rlce comparlsons
PoLel booklngs
W Jeb appllcaLlons requlrlng lnLegraLlon
wlLh dlverse programmlng languages
mb[duacbd | wwwLlnyurlcom/monlrb
@s and techn @s and techn
W P (Already a very popular for web
developmenL xML supporL CuL supporL
CC oLenLlal SCA exLenslon)
8ased on Jeb sLandards
W P11/(S) xML SCA JSuL uuul
mb[duacbd | wwwLlnyurlcom/monlrb
@he Web Serv|ce arch|tecture @he Web Serv|ce arch|tecture
Servlce
eglsLry
Servlce
rovlder
Servlce
Consumer
HuuI.sh l.tu
B.tu
Dnder|n @echn Dnder|n @echn
Web Serv|ce Stack Web Serv|ce Stack
Ubiquitous Communications: Internet
UniversaI Data Format: XML
Wire Format: Service Interactions: SOAP
Description: FormaI Service Descriptions: WSDL
SimpIe, Open, Broad Industry Support
Directory: PubIish & Find Services: UDDI
Inspection: Find Services on server: DISCO
nents a Web nents a Web
Serv|ce Serv|ce
A sLandard way for communlcaLlon (SCA9%
A unlform daLa represenLaLlon and exchange
mechanlsm (kML%
A sLandard meLa language Lo descrlbe Lhe servlces
offered (WSDL%
A mechanlsm Lo reglsLer and locaLe JS based
appllcaLlons (DDDI%
Web Serv|ce De|n|t|n Lanuae Web Serv|ce De|n|t|n Lanuae
(WSDL% (WSDL%
JSuL ls an xML formaL for descrlblng neLwork
servlces operaLlng on messages conLalnlng
elLher documenLorlenLed or procedure
orlenLed lnformaLlon
lL deflnes Jeb Servlce as collecLlon of neLwork
endpolnLs or porLs
Dn|versa Descr|t|n D|scver and Interat|n Dn|versa Descr|t|n D|scver and Interat|n
(DDDI% 9rtc (DDDI% 9rtc
nables enLerprlses Lo qulckly and dynamlcally
dlscover and lnvoke Jeb Servlces boLh
lnLernally and exLernally
?ellow pages of Jeb servlces
xamples
wwwuddlorg
wwwblomobyorg
wwwxmeLhodscom
SCA SCA
W Slmple Cb[ecL Access 9roLocol
W P11 + xML SCA
SCA equesL SCA equesL
CS1 /examples P11/11
userAgenL adlo userLand/70 (Jlnn1)
PosL localhosL81
ConLenL1ype LexL/xml charseLuLf8
ConLenLlengLh 474
SCAAcLlon /examples
?xml verslon10?
SCAnvnvelope SCAnvencodlngSLylehLLp//schemasxmlsoaporg/soap/encodlng/
xmlnsSCAnChLLp//schemasxmlsoaporg/soap/encodlng/ xmlnsSCA
nvhLLp//schemasxmlsoaporg/soap/envelope/
xmlnsxsdhLLp//wwww3org/1999/xMLSchema
xmlnsxslhLLp//wwww3org/1999/xMLSchemalnsLance
SCAnv8ody
mgeLClLyname xmlnsmhLLp//wwwsoapwareorg/
sLaLenumxslLypexsdlnL691003/sLaLenum
/ mgeLClLyname
/SCAnv8ody
/SCAnvnvelope
Soap envelope
Soap body
PLLp equesL header
SCA esponse SCA esponse
P11/11 200 Ck
ConnecLlon close
ConLenLLengLh 499
ConLenL1ype LexL/xml charseLuLf8
uaLe Jed 28 Mar 2001 030304 CM1
Server userLand lronLler/70Jlnn1
?xml verslon10?
SCAnvnvelope SCAnvencodlngSLylehLLp//schemasxmlsoaporg/soap/encodlng/
xmlnsSCAnChLLp//schemasxmlsoaporg/soap/encodlng/ xmlnsSCA
nvhLLp//schemasxmlsoaporg/soap/envelope/
xmlnsxsdhLLp//wwww3org/1999/xMLSchema
xmlnsxslhLLp//wwww3org/1999/xMLSchemalnsLance
SCAnv8ody
mgeLClLynameesponse xmlnsmhLLp//wwwsoapwareorg/
esulL xslLypexsdsLrlngkollam/esulL
/ mgeLClLynameesponse
/SCAnv8ody
/SCAnvnvelope
Soap envelope
Soap body
PLLp esponse header
SCA laulL SCA laulL
P11/11 300 Server rror
ConnecLlon close
ConLenLLengLh 311
ConLenL1ype LexL/xml charseLuLf8
uaLe Jed 28 Mar 2001 030632 CM1
Server userLand lronLler/70Jlnn1
?xml verslon10?
SCAnvnvelope SCAnvencodlngSLylehLLp//schemasxmlsoaporg/soap/encodlng/
xmlnsSCAnvhLLp//schemasxmlsoaporg/soap/envelope/
xmlnsxsdhLLp//wwww3org/1999/xMLSchema
xmlnsxslhLLp//wwww3org/1999/xMLSchemalnsLance
SCAnv8ody
SCAnvlaulL
faulLcodeSCAnvCllenL/faulLcode
faulLsLrlngCanL call geLClLyname because Lhere are Loo many parameLers/faulLsLrlng
/SCAnvlaulL
/SCAnv8ody
/SCAnvnvelope
PLLp esponse header
JhaL we need ln shorL JhaL we need ln shorL
W xML ouLpuL ls noL always slmplesL Lo puL ln
P code
W 1he xML ouLpuL ls repeLlLlve
W MosL of us are lazy
W Less work ls beLLer
W InShrt what |s needed |s a cass wh|ch
abstracts the SCA9 essaes r us
nuSCA nuSCA 1oolklL 1oolklL
W Several P LoolklLs avallable for SCA
W nuSCA usage ls slmple and efflclenL
W Cb[ecL CrlenLed
W uL hLLp//dleLrlchganx4com/nusoap/
W Pas supporL for JSuL generaLlon as well
A P luncLlon A P luncLlon
// eLurn Lhe S1u code for Lhe ClLy
funcLlon geLname ($plncode)
$clLynames array('691003' 'kollam'
'691233' 'rnakulam' '6943678'
'1rlvandrum')
reLurn $clLynames'$plncode'

SCA Server SCA Server
requ|re_nce(nusah%
5server new sa_server
5serverre|ster(geLClLyname%
5serverserv|ce
(5_SLIL@@9_AW_9CS@_DA@A%
ex|t(%
SCA CllenL SCA CllenL
requlre_once(nusoapphp)
$param array('plncode'691003')
$cllenL new soapcllenL
(hLLp//localhosL/servlcephp?wsdl)
$response $cllenLcall('geLClLyname $param)
$response wlll now have Lhe ClLy name for Lhe plncode
passed as parameLer
JhaL ls mlsslng? JhaL ls mlsslng?
W JhaL lf you donL pass a lncode ?
W JhaL lf you donL geL a resulL?
W JhaL lf
W SCA laulL generaLlon
P luncLlon revlsLed P luncLlon revlsLed
/ eLurn Lhe S1u code for Lhe ClLy
funcLlon geLClLyname ($plncode)
global $db
| (5|ncde %
]* eturn a SCA9 aut |nd|cat|n a bank |ncde *]
return new sa_aut(
|ent
Must su a |ncde
%

$clLynames array('691003' 'kollam' '691233' 'rnakulam' '6943678'
'1rlvandrum')
reLurn $clLynames'$plncode'

SCA CllenL SCA CllenL revlsLed revlsLed
requlre_once(nusoapphp)
$param array('plncode'691003')
$cllenL $cllenL new soapcllenL
(hLLp//localhosL/servlcephp?wsdl)
$response $cllenLcall(geLClLyname $param)
|(5c|entaut%
ech IADL@ de 5c|entautcde br ]
ech Str|n 5c|entautstr|n ]
ese
ech 5resnse
Some conslderaLlons Some conslderaLlons
W SCA LransacLlons/sesslon
W SCA auLhenLlcaLlon and securlLy
SCA esources SCA esources
W CLher P SCA lmplemenLaLlons
PSCA xLenslon
AcLlvesLaLe SJSAl for P
Manuel Lemos SCA class
SCA esources SCA esources
W SCA and web servlces reference slLes

hLLp//wwwxmlcom/pub/a/2001/04/04/webs
ervlces/
xMLcom A Jeb Servlces rlmer
hLLp//wwww3corg/Lr/soap
SCA 11 speclflcaLlon
hLLp//www
106lbmcom/developerworks/webservlces/
l8M developerJorks Jeb Servlces Zone
eerences eerences
W lchards (2006) lto lnl \Ml ooJ web 5etvlces Apress
mb[duacbd | wwwLlnyurlcom/monlrb
;uest|ns ;uest|ns
W ??
W Sllde avallable ln
wwwscrlbdcom/monlrbhulyan
mb[duacbd | wwwLlnyurlcom/monlrb

You might also like