Web hosting directory - 500 CHAPTER 20 WEB SERVICES // Register
500 CHAPTER 20 WEB SERVICES // Register the getRandQuote() function. $server->register(”getRandQuote”, array(’format’ => ‘xsd:string’), array(’return’ => ‘xsd:string’), ‘urn:boxing’, ‘urn:boxing#getRandQuote’); function getRandQuote() { $pg = pg_connect(”host=localhost user=jason password=secret dbname=corporate”); $query = “SELECT boxer, quote, year FROM quotation ORDER BY RAND() LIMIT 1″; $result = pg_query($query); $row = pg_fetch_array($result); $boxer = $row[”boxer”]; $quote = $row[”quote”]; $year = $row[”year”]; return “”$quote”, $boxer ($year)”; } $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : ‘’; $server->service($HTTP_RAW_POST_DATA); ?> Fault Handling NuSOAP offers a class for handling errors that may occur during execution. This class, named soap_fault, has four attributes: faultactor: This optional attribute indicates which service caused the error. faultcode: This required attribute indicates the type of error. There are four possible values: Client, MustUnderstand, Server, and VersionMismatch. A Client error is returned when an error message is found within the message returned by the client. A MustUnderstand error occurs when a mandatory header has been found that is not understood. A Servererror occurs when a processing error has occurred on the server. Finally, a VersionMismatch error occurs when incompatible namespaces have been used. faultdetail: This optional attribute contains additional information about the error. faultstring: This required attribute contains an error description. These attributes are initialized via the class constructor, like so:
We recommend high quality webhost to host and run your jsp application: christian web host services.