EIE424 Distributed Systems and Networking Programming -PartIl 3.1 SOAP-Introduction SOAP Communication Styles SOAP supports two different communication styles RPC Style e Uses the soaP rPc conventions hence the communication method and procedure are governed by the conventions Conceptually similar to other RPCs The default of early SOAP implementations Document Style e Also known as message-oriented style ● Sending non-encodedⅩ ML content o Require more programming work on server and client sides to interpret the messages e More flexible communication and provides the best 6 interoperability
6 EIE424 Distributed Systems and Networking Programming –Part II 3.1 SOAP – Introduction SOAP Communication Styles ⚫ SOAP supports two different communication styles: – RPC Style ⚫ Uses the SOAP RPC conventions, hence the communication method and procedure are governed by the conventions ⚫ Conceptually similar to other RPCs ⚫ The default of early SOAP implementations – Document Style ⚫ Also known as message-oriented style ⚫ Sending non-encoded XML content ⚫ Require more programming work on server and client sides to interpret the messages ⚫ More flexible communication and provides the best interoperability
EIE424 Distributed Systems and Networking Programming -PartIl 3.1 SOAP-Introduction A Sample request in RPC Style <?xm1 versIOn=1.0′ encoding=UF-8′?> <SOAP-ENV: Envelope xmlns:xsi=wnttp://www.w3.org/2001/xmlschema-instance"/in xmlns: Soap-env=whtTp: //schemas. xmlsoap. org/soap/envelo xmlns:xsd=whttp://www.w3.org/2001/xmlschema"> <SOAP-ENV: Body> <ns1: getfemp xmlns: nsl=urn: xmethods-Temperature SOAP-ENV: encodingstyle= whttp://schemas.xmlsoap.org/soap/encoding/n> <zipcode xsi: type=xsd: string>10016</zipcode> </ns1: getTemp> Try to call the remote method getTemp </SOAP-ENV: Body </SOAP-ENV: Envelope> with input parameter, a zipcode: 10016
7 EIE424 Distributed Systems and Networking Programming –Part II 3.1 SOAP – Introduction <?xml version=‘1.0’ encoding=‘UTF-8’?> <SOAP-ENV:Envelope xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=“http://www.w3.org/2001/XMLSchema”> <SOAP-ENV:Body> <ns1:getTemp xmlns:ns1=“urn:xmethods-Temperature” SOAP-ENV:encodingStyle= “http://schemas.xmlsoap.org/soap/encoding/”> <zipcode xsi:type=“xsd:string”>10016</zipcode> </ns1:getTemp> </SOAP-ENV:Body> </SOAP-ENV:Envelope> A Sample Request in RPC Style Try to call the remote method getTemp with input parameter, a zipcode: 10016
EIE424 Distributed Systems and Networking Programming -PartIl 3.1 SOAP-Introduction A Sample response in RPc Style <?xm1 versIon=11.0′ encoding=UF-8′?> <SOAP-ENV: Envelope xmlns: sOap-Env=WhttP: //schemas. xmlsoap. org/soap/envelope/n xmlns:xsi=whttp://wwW.w3.org/2001/xmlschema-instance xmlns:xsd=whttp://www.w3.org/2001/xmlschema"> <SOAP-ENV: Body> <nsl: getTempResponse xmlns: nsl=urn: xme thods-femperature SOAP-ENV: encodingstyle= http://schemas.xmlsoap.org/soap/encoding/> <return xsi: type=xsd: float">71.0</return> </ns1: getTempResponse> </SOAP-ENV: Body> </SOAP-ENV: Envelope> Return a double 71.0 which represents the temperature
8 EIE424 Distributed Systems and Networking Programming –Part II 3.1 SOAP – Introduction A Sample Response in RPC Style <?xml version=‘1.0’ encoding=‘UTF-8’?> <SOAP-ENV:Envelope xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=“http://www.w3.org/2001/XMLSchema”> <SOAP-ENV:Body> <ns1:getTempResponse xmlns:ns1=“urn:xmethods-Temperature” SOAP-ENV:encodingStyle= “http://schemas.xmlsoap.org/soap/encoding/”> <return xsi:type=“xsd:float”>71.0</return> </ns1:getTempResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope> Return a double 71.0 which represents the temperature
EIE424 Distributed Systems and Networking Programming -PartIl 3.1 SOAP-Introduction SOAP Messages o In most cases, we do not need to directly programming in SOAP o Dozens of SoAP implementations now freely exist on the Internet Apache SOAP(Axis) Microsoft soap toolkit o Allow generating SoAP messages automatically using High Level Language, e. g. Java, C++, Perl Understanding of SOAP message structure enables us to intercept a SoAP transaction and to debug a SOAP application
9 EIE424 Distributed Systems and Networking Programming –Part II 3.1 SOAP – Introduction SOAP Messages ⚫ In most cases, we do not need to directly programming in SOAP ⚫ Dozens of SOAP implementations now freely exist on the Internet – Apache SOAP (Axis) – Microsoft SOAP ToolKit ⚫ Allow generating SOAP messages automatically using High Level Language, e.g. Java, C++, Perl ⚫ Understanding of SOAP message structure enables us to intercept a SOAP transaction and to debug a SOAP application
EIE424 Distributed Systems and Networking Programming -PartIl 3.1 SOAP-Introduction Message SOAP Message Structure Envelope(mandatory) Header(optional) Body(mandatory) Fault(optional) 10
10 EIE424 Distributed Systems and Networking Programming –Part II 3.1 SOAP – Introduction Message Structure SOAP Message Envelope (mandatory) Header (optional) Body (mandatory) Fault (optional)