1. Both simpleType and complexType can be used to create new XML schema types. Once defined such a type could be used as the type of an element tag. XSD Simple Type Example: XSD Complex Type Example: simpleType: a. must be string data as opposed to being allowed to contain other types. b. no attributes c. no nested elements complexType: a. no restriction on types b. allow multiple attributes. c. allow nested elements 2. In REST, the url of the web service can be viewed as the method call. The query string passed with the url can be viewed as the parameters supplied to the method. The idea is that an aplication state/method is viewed as a resource. Each resource has a URL and we invoke the resource through the URL, passing the query string as the parameters. For example if create_business is a webservice accepting parameters format=xml and busID=1, then using REST, we can invoke it as http://localhost/create_business/?formate=xml&busID=1 3. $key

; } } ?> 4. flock() is used to lock files so that more than one script cannot do a concurrent write. LOCK_SH is used to do a shared reading. OR is used to get a shared/read lock. ex: flock($fp, LOCK_SH); Locks are released using flock($fp, LOCL_UN) or fclose() releases locks too. Code example: 5. PHP sessions are typically implemented using cookies. To use sessions a PHP script uses the command session_start() while it is still possible to output HTTP headers. This command does two main things: (1) it sets a cookie (defaults to the name PHPSESSID with value some randomly generated string) i.e., it adds a Set-Cookie: header to do this. (2) if a Cookie: header with name PHPSESSID (or whatever is the session name) was sent from the browser it looks up a file in the session directory corresponding to the value of this session id. This file contains name value pairs that have been associated this the session. To access/set these pairs you use the $_SESSION super-global. For example, to see what bob is set to one could do: echo $_SESSION["bob"]; To set the value of bob one could do: $_SESSION["bob"] = "toast"; 6. "; } mysql_close($con); ?> 7. 8. $subject = "notice"; $email = john@email.com; $message = "Hi ther long time no see."; mail($email,$subject,$message,"From: $email"); 9. When a X509 certificate is self-signed, if the Issuer and the Subject are the same. We can create a self-signed certificate if we generate the certificate signing request, and then sign it with our private key rather than get some well-known CA to sign it. A browser has a list of certificates (which contain public keys) of well-known CAs. If the browser cannot find the public key of a CA to verify a certificate, it will complain. This is true of self-generated certificates and hence, the browser will complain. 10.