220 likes | 426 Views
3. WS protocol stack. WS predecessors: RPC RMI CORBA JMS. 5. SOAP – scenario + architecture. SOAP message. <?xml version="1.0"?> <soap:Envelope xmlns:soap= "http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle= "http://www.w3.org/2001/12/soap-encoding">
E N D
3. WS protocol stack • WS predecessors: • RPC • RMI • CORBA • JMS
SOAP message <?xml version="1.0"?> <soap:Envelope xmlns:soap= "http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle= "http://www.w3.org/2001/12/soap-encoding"> <soap:Header> ... </soap:Header> <soap:Body> ... <soap:Fault> ... </soap:Fault> </soap:Body> </soap:Envelope>
SOAP Request - Response <?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"> <soap:Body> <m:GetPrice xmlns:m="http://www.w3schools.com/prices"> <m:Item>Apples</m:Item> </m:GetPrice> </soap:Body> </soap:Envelope> <?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"> <soap:Body> <m:GetPriceResponse xmlns:m="http://www.w3schools.com/prices"> <m:Price>1.90</m:Price> </m:GetPriceResponse> </soap:Body> </soap:Envelope>
WSDL example (1) <definitions xmlns:soa="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://s/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://s/" name="Sj1ServService"> <types> <xsd:schema> <xsd:import namespace="http://s/" schemaLocation="http://localhost:2002/Sj1S?xsd=1"></xsd:import> </xsd:schema> </types> <message name="upcase"> <part name="parameters" element="tns:upcase"></part> </message> <message name="upcaseResponse"> <part name="parameters" element="tns:upcaseResponse"></part> </message> <message name="ping"> <part name="parameters" element="tns:ping"></part> </message> <message name="pingResponse"> <part name="parameters" element="tns:pingResponse"></part> </message>
WSDL example (2) <message name="add"> <part name="parameters" element="tns:add"></part> </message> <message name="addResponse"> <part name="parameters" element="tns:addResponse"></part> </message> <portType name="Sj1Serv"> <operation name="upcase"> <input message="tns:upcase"></input> <output message="tns:upcaseResponse"></output> </operation> <operation name="ping"> <input message="tns:ping"></input> <output message="tns:pingResponse"></output> </operation> <operation name="add"> <input message="tns:add"></input> <output message="tns:addResponse"></output> </operation> </portType>
WSDL example (3) <binding name="Sj1ServPortBinding" type="tns:Sj1Serv"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"></soap:binding> <operation name="upcase"> <soap:operation soapAction=""></soap:operation> <input> <soap:body use="literal"></soap:body> </input> <output> <soap:body use="literal"></soap:body> </output> </operation> <operation name="ping"> <soap:operation soapAction=""></soap:operation> <input> <soap:body use="literal"></soap:body> </input> <output> <soap:body use="literal"></soap:body> </output> </operation> <operation name="add"> <soap:operation soapAction=""></soap:operation> <input> <soap:body use="literal"></soap:body> </input> <output> <soap:body use="literal"></soap:body> </output> </operation> </binding> <service name="Sj1ServService"> <port name="Sj1ServPort" binding="tns:Sj1ServPortBinding"> <soap:address location="http://localhost:2002/Sj1S"></soap:address> </port> </service> </definitions>
WS-SOAP distributions C#: IIS + a file *.asmx Java: JAX-WS, AXIS1, AXIS2 PHP: NuSOAP, PHP-SOAP Python: Djngo, CherryPy, soaplib, spyne, suds
C# calls d:\Florin\Carti\SWMPA\5Soap\Cs\Exec>Sss1Clie Client C# SOAP for C# service Ss1Serv ping: C# SOAP win.scs.ubbcluj.ro (172.30.0.14:80) 3/9/2013 4:53:08 PM upcase: negru = NEGRU add: 66 + 75 = 141 ping: C# SOAP win.scs.ubbcluj.ro (172.30.0.14:80) 3/9/2013 4:53:08 PM d:\Florin\Carti\SWMPA\5Soap\Cs\Exec>Ssj1Clie Client C# SOAP for Java service Sj1ServService ping: Java SOAP RLF (169.254.214.123:2002), Sat Mar 09 16:52:46 EET 2013 upcase: negru = NEGRU add: 66 + 75 = 141 ping: Java SOAP RLF (169.254.214.123:2002), Sat Mar 09 16:52:46 EET 2013 d:\Florin\Carti\SWMPA\5Soap\Cs\Exec>Ssh1Clie Client C# SOAP for PHP service Sh1Serv ping: PHP SOAP 192.168.2.100 (192.168.2.100:80), 2013.03.09 15:52:53 upcase: negru = NEGRU add: 66 + 75 = 141 ping: PHP SOAP 192.168.2.100 (192.168.2.100:80), 2013.03.09 15:52:54 d:\Florin\Carti\SWMPA\5Soap\Cs\Exec>Ssy1Clie Client C# SOAP for Python service Sy1Serv ping: Python SOAP RLF(169.254.214.123:2004) datetime.datetime(2013, 3, 9, 16, 53, 0, 322000) upcase: negru = NEGRU add: 66 + 75 = 141 ping: Python SOAP RLF(169.254.214.123:2004) datetime.datetime(2013, 3, 9, 16, 53, 0, 434000)
Java calls d:\Florin\Carti\SWMPA\5Soap\Java\Exec>java -Djava.util.logging.config.file=NIMIC Sjs1Clie Client Java SOAP for C# service org.apache.cxf.jaxws.JaxWsClientProxy@b0561a ping: C# SOAP win.scs.ubbcluj.ro (172.30.0.14:80) 3/9/2013 4:55:09 PM upcase: negru = NEGRU add: 66 + 75 = 141 ping: C# SOAP win.scs.ubbcluj.ro (172.30.0.14:80) 3/9/2013 4:55:09 PM d:\Florin\Carti\SWMPA\5Soap\Java\Exec>java -Djava.util.logging.config.file=NIMIC Sjj1Clie Client Java SOAP for Java service org.apache.cxf.jaxws.JaxWsClientProxy@1428b92 ping: Java SOAP RLF (169.254.214.123:2002), Sat Mar 09 16:54:48 EET 2013 upcase: negru = NEGRU add: 66 + 75 = 141 ping: Java SOAP RLF (169.254.214.123:2002), Sat Mar 09 16:54:48 EET 2013 d:\Florin\Carti\SWMPA\5Soap\Java\Exec>java -Djava.util.logging.config.file=NIMIC Sjh1Clie Client Java SOAP for PHP service h.Sh1ServBindingStub@41f871 ping: PHP SOAP localhost (127.0.0.1:80), 2013.03.09 15:54:54 upcase: negru = NEGRU add: 66 + 75 = 141 ping: PHP SOAP localhost (127.0.0.1:80), 2013.03.09 15:54:55 d:\Florin\Carti\SWMPA\5Soap\Java\Exec>java -Djava.util.logging.config.file=NIMIC Sjy1Clie Client Java SOAP for Python service org.apache.cxf.jaxws.JaxWsClientProxy@14ef725 ping: Python SOAP RLF(169.254.214.123:2004) datetime.datetime(2013, 3, 9, 16, 55, 1, 974000) upcase: negru = NEGRU add: 66 + 75 = 141 ping: Python SOAP RLF(169.254.214.123:2004) datetime.datetime(2013, 3, 9, 16, 55, 2, 30000)
Python calls d:\Florin\Carti\SWMPA\5Soap\Python\Exec>python Sy1Clie.py Client Python SOAP <suds.client.Client object at 0x0279BFF0> ping: Python SOAP RLF(169.254.214.123:2004) datetime.datetime(2013, 3, 9, 17, 0, 5, 114000) upcase: negru = NEGRU add: 66 + 75 = 141 ping: Python SOAP RLF(169.254.214.123:2004) datetime.datetime(2013, 3, 9, 17, 0, 5, 150000) d:\Florin\Carti\SWMPA\5Soap\Python\Exec>python Sy1Clie.py http://win.scs.ubbcluj.ro/~florin/Ss1Serv.asmx Client Python SOAP <suds.client.Client object at 0x024D0CB0> ping: C# SOAP win.scs.ubbcluj.ro (172.30.0.14:80) 3/9/2013 5:01:06 PM upcase: negru = NEGRU add: 66 + 75 = 141 ping: C# SOAP win.scs.ubbcluj.ro (172.30.0.14:80) 3/9/2013 5:01:07 PM d:\Florin\Carti\SWMPA\5Soap\Python\Exec>python Sy1Clie.py http://localhost:2002 Client Python SOAP <suds.client.Client object at 0x0251AFF0> ping: Java SOAP RLF (169.254.214.123:2002), Sat Mar 09 17:01:16 EET 2013 upcase: negru = NEGRU add: 66 + 75 = 141 ping: Java SOAP RLF (169.254.214.123:2002), Sat Mar 09 17:01:16 EET 2013 d:\Florin\Carti\SWMPA\5Soap\Python\Exec>python Sy1Clie.py http://localhost/Sh1Serv.php Client Python SOAP <suds.client.Client object at 0x02580FF0> ping: PHP SOAP localhost (127.0.0.1:80), 2013.03.09 16:01:36 upcase: negru = NEGRU add: 66 + 75 = 141 ping: PHP SOAP localhost (127.0.0.1:80), 2013.03.09 16:01:36 d:\Florin\Carti\SWMPA\5Soap\Python\Exec>python Sy1Clie.py http://localhost:2004 Client Python SOAP <suds.client.Client object at 0x0243AFF0> ping: Python SOAP RLF(169.254.214.123:2004) datetime.datetime(2013, 3, 9, 17, 1, 42, 2000) upcase: negru = NEGRU add: 66 + 75 = 141 ping: Python SOAP RLF(169.254.214.123:2004) datetime.datetime(2013, 3, 9, 17, 1, 42, 15000)