Page 259 -
P. 259

Chapter 6  The Cloud
                258


















                Figure 6-15a
                Example XML Document



                                                                 {
                                                                  "firstName": "Kelly",
                                                                  "lastName": "Summers",
                                                                  "dob": "12/28/1985",
                                                                  "address":{
                                                                    "streetAddress": "309 Elm Avenue",
                                                                    "city": "San Diego",
                                                                    "state": "CA",
                                                                    "postalCode": "98225"
                                                                  },
                                                                  "phoneNumber": [
                                                                    {
                                                                     "type": "home",
                                                                     "number": "685 555 1234"
                                                                    },
                                                                    {
                                                                     "type": "cell",
                                                                     "number": "685 555 5678"
                                                                    }
                Figure 6-15b                                      ]
                Example JSON Document                            }

                                               Service authors (computer programmers) create WSDL documents to describe the services
                                            they provide and the inputs and outputs required. These WSDL documents are seldom read by
                                            humans.  Instead,  developer tools like  Microsoft  Visual  Studio  read the  WSDL to  configure the
                                              programming environment for programmers who write code to access that service.
                                               As shown in Figure  6-14, SOAP,  which is not an acronym  though it  looks  like one, is a
                                              protocol that sits on top of http and the lower-level Internet protocols. Sits on top of means that it
                                            uses http to send and receive SOAP messages. (SOAP can also use smtp.) Programs that use Web
                                            services issue SOAP messages to request services; the Web service uses SOAP messages to return
                                            responses to service requests.
                                               Finally, XML and JSON are ways of marking up documents so that both the service requestor
                                            and the service provider know what data they’re processing.Figure 6-15 shows a simple example
                                            of both. As you can see, XML documents contain as much metadata as they do application data.
                                            These metadata are used to ensure that the document is complete and properly formatted. XML
                                            is used when relatively few messages are being transmitted and when ensuring a complete and
                                              correct document is crucial. Both WSDLs and SOAP messages are coded in XML.
                                               As its name indicates, JSON uses the notation for JavaScript objects to format data. It has
                                            much less metadata and is preferred for the transmission of voluminous application data. Web
                                            servers use JSON as their primary way of sending application data to browsers.
   254   255   256   257   258   259   260   261   262   263   264