Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Web Services
Applications
Directory service Security Choreography
SOAP
InstructorsGuideforCoulouris,Dollimore,KindbergandBlair,DistributedSystems:ConceptsandDesignEdn.5
PearsonEducation2012
Figure 9.2
The travel agent service combines other web services
flight bookinga
flight booking
b
Travel Agent
Client
Service hire car bookinga
InstructorsGuideforCoulouris,Dollimore,KindbergandBlair,DistributedSystems:ConceptsandDesignEdn.5
PearsonEducation2012
Figure 9.3
SOAP message in an envelope
envelope
header
body
body element body element
InstructorsGuideforCoulouris,Dollimore,KindbergandBlair,DistributedSystems:ConceptsandDesignEdn.5
PearsonEducation2012
Figure 9.4
Example of a simple request without headers
m:exchange
xmlns:m = namespace URI of the service description
m:arg1 m:arg2
Hello World
In this figure and the next, each XML element is represented by a shaded
box with its name in italic followed by any attributes and its content
InstructorsGuideforCoulouris,Dollimore,KindbergandBlair,DistributedSystems:ConceptsandDesignEdn.5
PearsonEducation2012
Figure 9.5
Example of a reply corresponding to the request in Figure 9.4
InstructorsGuideforCoulouris,Dollimore,KindbergandBlair,DistributedSystems:ConceptsandDesignEdn.5
PearsonEducation2012
Figure 9.6
Use of HTTP POST Request in SOAP client-server communication
header
Host:www.cdk4.net
HTTP
ContentType:application/soap+xml
Action:http://www.cdk4.net/examples/stringer#exchange action
<env:envelopexmlns:env= namespaceURIforSOAPenvelope
<env:header></env:header>
message
<env:body></env:body>
Soap
</env:Envelope>
InstructorsGuideforCoulouris,Dollimore,KindbergandBlair,DistributedSystems:ConceptsandDesignEdn.5
PearsonEducation2012
Figure 9.7
Java web service interface ShapeList
importjava.rmi.*;
publicinterfaceShapeListextendsRemote{
intnewShape(GraphicalObjectg)throwsRemoteException;1
intnumberOfShapes()throwsRemoteException;
intgetVersion()throwsRemoteException;
intgetGOVersion(inti)throwsRemoteException;
GraphicalObjectgetAllState(inti)throwsRemoteException;
}
InstructorsGuideforCoulouris,Dollimore,KindbergandBlair,DistributedSystems:ConceptsandDesignEdn.5
PearsonEducation2012
Figure 9.8
Java implementation of the ShapeList server
importjava.util.Vector;
publicclassShapeListImplimplementsShapeList{
privateVectortheList=newVector();
privateintversion=0;
privateVectortheVersions=newVector();
publicintnewShape(GraphicalObjectg)throwsRemoteException{
version++;
theList.addElement(g);
theVersions.addElement(newInteger(version));
returntheList.size();
}
publicintnumberOfShapes(){}
publicintgetVersion(){}
publicintgetGOVersion(inti){}
publicGraphicalObjectgetAllState(inti){}
}
InstructorsGuideforCoulouris,Dollimore,KindbergandBlair,DistributedSystems:ConceptsandDesignEdn.5
PearsonEducation2012
Figure 9.9
Java implementation of the ShapeList client
packagestaticstub;
importjavax.xml.rpc.Stub;
publicclassShapeListClient{
publicstaticvoidmain(String[]args){/*passURLofservice*/
try{
Stubproxy=createProxy();1
proxy._setProperty2
(javax.xml.rpc.Stub.ENDPOINT_ADDRESS_PROPERTY,args[0]);
ShapeListaShapeList=(ShapeList)proxy;3
GraphicalObjectg=aShapeList.getAllState(0);4
}catch(Exceptionex){ex.printStackTrace();}
}
privatestaticStubcreateProxy(){5
return
(Stub)(newMyShapeListService_Impl().getShapeListPort());6
}
}
InstructorsGuideforCoulouris,Dollimore,KindbergandBlair,DistributedSystems:ConceptsandDesignEdn.5
PearsonEducation2012
Figure 9.10
The main elements in a WSDL description
definitions
types message interface bindings services
InstructorsGuideforCoulouris,Dollimore,KindbergandBlair,DistributedSystems:ConceptsandDesignEdn.5
PearsonEducation2012
Figure 9.11
WSDL request and reply messages for the newShape operation
InstructorsGuideforCoulouris,Dollimore,KindbergandBlair,DistributedSystems:ConceptsandDesignEdn.5
PearsonEducation2012
Figure 9.12
Message exchange patterns for WSDL operations
Name Messagessentby
InstructorsGuideforCoulouris,Dollimore,KindbergandBlair,DistributedSystems:ConceptsandDesignEdn.5
PearsonEducation2012
Figure 9.13
WSDL operation newShape
InstructorsGuideforCoulouris,Dollimore,KindbergandBlair,DistributedSystems:ConceptsandDesignEdn.5
PearsonEducation2012
Figure 9.14
SOAP binding and service definitions
binding service
name = ShapeListBinding name = "MyShapeListService"
type = tns:ShapeList
soap:binding transport = URI endpoint
for schemas for soap/http
style= "rpc" name = "ShapeListPort"
binding = "tns:ShapeListBinding"
operation
name= "newShape"
input soap:address
soap:body location = service URI
encoding, namespace
output
soap:body
encoding, namespace
InstructorsGuideforCoulouris,Dollimore,KindbergandBlair,DistributedSystems:ConceptsandDesignEdn.5
PearsonEducation2012
Figure 9.15
The main UDDI data structures
businessEntity businessServices
human readable businessServices
information
businessServices bindingTemplate
about the publisher
human readable
bindingTemplate
information URL
about a bindingTemplate tModel
family of services information tModel
about the
URL
serviceinterfaces
service interfaces
tModel
key URL
key service descriptions
key
InstructorsGuideforCoulouris,Dollimore,KindbergandBlair,DistributedSystems:ConceptsandDesignEdn.5
PearsonEducation2012
Figure 9.16
Algorithms required for XML signature
InstructorsGuideforCoulouris,Dollimore,KindbergandBlair,DistributedSystems:ConceptsandDesignEdn.5
PearsonEducation2012
Figure 9.17
Algorithms required for encryption(in Figure 9.16 are also required)
InstructorsGuideforCoulouris,Dollimore,KindbergandBlair,DistributedSystems:ConceptsandDesignEdn.5
PearsonEducation2012
Figure 9.18
Travel agent scenario
1.Theclientasksthetravelagentserviceforinformationaboutasetofservices;forexample,flights,car
hireandhotelbookings.
2.Thetravelagentservicecollectspricesandavailabilityinformationandsendsittotheclient,which
choosesoneofthefollowingonbehalfoftheuser:
(a)refinethequery,possiblyinvolvingmoreproviderstogetmoreinformation,thenrepeatstep2;
(b)makereservations;
(c)quit.
3.Theclientrequestsareservationandthetravelagentservicechecksavailability.
4.Eitherallareavailable;
orforservicesthatarenotavailable;
eitheralternativesareofferedtotheclientwhogoesbacktostep3;
ortheclientgoesbacktostep1.
5.Takedeposit.
6.Givetheclientareservationnumberasaconfirmation.
7.Duringtheperioduntilthefinalpayment,theclientmaymodifyorcancelreservations
InstructorsGuideforCoulouris,Dollimore,KindbergandBlair,DistributedSystems:ConceptsandDesignEdn.5
PearsonEducation2012
Figure 9.19
A selection of Amazon Web Services
InstructorsGuideforCoulouris,Dollimore,KindbergandBlair,DistributedSystems:ConceptsandDesignEdn.5
PearsonEducation2012