soap.rpc.client
| Syntax |
soap.rpc.client (actionURI, methodName, adrparams, rpcServer, rpcPort, username, password, fldebug, ticksToTimeOut, flShowMessages, soapAction, methodNamespace, methodNamespaceURI, customStructType, customNamespace, customNamespaceURI, charset)
|
| Params |
actionUri is a string, which is the path used in the HTTP request, when calling a SOAP-RPC server. It is used on the server-side to identify the path to a SOAP-RPC handler. methodName is a string used to identify a SOAP-RPC handler by name. adrParams is the address of a list or record; these are the parameters that will be sent with the procedure call. rpcServer is a string, a domain name or dotted ID of a server supporting SOAP-RPC; it defaults to "localhost". rpcPort is a number, the port number of the SOAP-RPC server; it defaults to the port that HTTP is configured to run on, on the client machine. username is a string, used for authenticating a SOAP-RPC caller. The default value is the empty string. password is a string, used for authenticating a SOAP-RPC caller. The default value is the empty string. flDebug, a boolean, indicates whether you want a copy of the request stored in scratchpad.httpCommand and a copy of the result in scratchpad.httpResult. Default value is false. ticksToTimeOut is the number of sixtieths of a second before the request times out with a scriptError. The default value is 30 seconds. The default is stored in ticks at user.betty.prefs.rpcClientDefaultTimeout and can be changed. flShowMessages is a boolean; if true, Frontier's About window displays real-time messages at the HTTP level. The default value is true. soapAction is a string, which is used for the value of the SOAPAction HTTP header. The default is the value of actionURI. methodNamespace specifies a namespace prefix for the method call element -- the first sub-element of <Body> in the SOAP <Envelope>. The default value is nil, meaning there will be no namespace qualification. methodNamespaceURI specifies the URI associated with methodNamespace. The default value is nil, meaning no namespaceURI attribute will be added to the method call element. customStructType, customNamespace, and customNamespaceURI are used to specify a type, namespace prefix, and namespaceURI for structs, and arrays of structs (lists of tables). charset is used to specify the character encoding to use for the request. The default is us-ascii. Other possible values are utf-8 and utf-16.
|
| Action |
Sends a remote procedure call to the indicated server with the indicated parameters, and passes the response back to the caller.
|
| Returns |
The value returned by the SOAP handler on the server.
|
| Examples |
local (params = {"statenum":3}); soap.rpc.client ("/examples", "getStateName", @params) //runs on localhost » "Arizona"
local (params = {"num1":18, "num2":31, "num3":2, "num4":44}); soap.rpc.client ("/examples", "getStateNames", @params, "www.manilasites.com", 80)
try {local (params = {}); soap.rpc.client ("/wild/Beatnik", "Pie", @params)} else {tryError}
|
| Errors |
If the server doesn't respond within ticksToTimeOut sixtieths of a second, soap.rpc.client will give up by generating a scriptError. If the server doesn't speak SOAP, you may get a cryptic XML-level error message, complaining about poorly formed text. (Many servers respond with HTML, which in some ways looks like XML.)
|
| Notes |
SOAP arrays of structs are returned as Frontier tables. A Void is returned as an empty Frontier table. When calling a SOAP-RPC method which takes an array of structs as its input parameter, customStructType, customNamespace, and customNamespaceURI must all have a value, or an error will be generated. Most SOAP implementations require that the method call element -- the first sub-element of <Body> in a SOAP <Envelope> -- have namespace qualification, which is specified using the methodNamespace and methodNamespaceURI parameters. The value of both parameters is arbitrary, and most implementations only enforce their presence, and not their values. This verb is implemented as a script. It encodes the parameter list and procedure name in XML and sends it to the server. The response is also XML-encoded; it's converted to a Frontier data structure and returned to the caller. This is one of two core routines in Frontier's SOAP-RPC functionality. The other side, the server, is implemented in soap.rpc.server.
|
| See Also |
soap.rpc.server
|