CHAPTER 8 – XML-RPC – Response

When the function call succeeds, an XML-RPC response is returned to the caller program, encoded in XML. There are basically two dif- ferent responses possible to a request: a normal response (methodResponse), shown in the following example, or a fault. You can recognize a normal response by the <params /> child element of the <methodReponse /> tag. A successful methodResponse always has one <params /> child, which always has one <param /> child. You can't return more than one value from within a function, but you can return a <struct /> or an <array /> to mimic returning multiple values. The methodResponse shows the result of the request shown in the previous section: <?xml version="1.0"?> <methodResponse> <params> <param> <value><string>Hi Derick!</string></value> </param> </params> </methodResponse>

Post Comment
Login to post comments