- Parameters of procedure to run
- Type of parameter
- Call to SOAPRun
- Managing errors
SOAPRun (Function) In french: SOAPExécute Runs a procedure on a SOAP server. Remarks: - The procedure parameters must be specified before using SOAPRun via the SOAP structure (see the Notes).
- This function does not support the non-Latin languages.
// Define the parameters of the "Temperature" procedure that // returns the temperature of a city identified by its zip code SOAP.Value[1] = 94010 SOAP.Name[1] = "ZipCode" SOAP.Type[1] = SOAPStringType // Run the "Temperature" procedure on a non-WINDEV server ResExecute = SOAPRun("http://www.Temp.com/Degree", "Temperature", "urn:Temp-Degree")
Syntax
Running a procedure on a WINDEV SOAP server Hide the details
<Result> = SOAPRun(<URL of SOAP server> , <Procedure name> , <Procedure Namespace> [, <Procedure action> [, <Encoding style>]])
<Result>: Boolean - True if the communication was established with the SOAP server,
- False otherwise. To get more details on the error, use ErrorInfo.
<URL of SOAP server>: Character string URL of SOAP server to contact. This parameter is supplied in the documentation of SOAP server. For a SOAP server created by WINDEV, the "/.soap" string must be added after the URL. For example: "http://192.168.1.138/.soap". <Procedure name>: Character string Name of procedure that will be run on the specified SOAP server. This parameter is supplied in the documentation of SOAP server. <Procedure Namespace>: Character string Namespace of procedure to run. This parameter is supplied in the documentation of SOAP server. This parameter is mandatory if you are using a WINDEV SOAP server. The name of the library (WDL) is specified via the namespace ("<Name of Server application>" becomes on the server "c:\soapmodules\<Name of Server application>.wdl "). Remark: The urn: keyword is not required in this parameter. <Procedure action>: Optional character string Action of procedure (also called "SOAPAction"). This parameter is supplied in the documentation of SOAP server. <Encoding style>: Optional character string Encoding style of procedure (also called "EncodingStyle"). This parameter is supplied in the documentation of SOAP server.
Running a procedure on an ordinary SOAP server Hide the details
<Result> = SOAPRun(<URL of SOAP server> , <Procedure name> [, <Procedure Namespace> [, <Procedure action> [, <Encoding style>]]])
<Result>: Boolean - True if the communication was established with the SOAP server,
- False otherwise. To get more details on the error, use ErrorInfo.
<URL of SOAP server>: Character string URL of SOAP server to contact. This parameter is supplied in the documentation of SOAP server. To submit a request with authentication, this parameter must correspond to:http://user:password@ServerURL The port can also be specified in the following syntax: http://user:password@ServerURL:port <Procedure name>: Character string Name of procedure that will be run on the specified SOAP server. This parameter is supplied in the documentation of SOAP server. <Procedure Namespace>: Optional character string (mandatory for a WINDEV SOAP server) Namespace of procedure to run. This parameter is supplied in the documentation of SOAP server. <Procedure action>: Optional character string Action of procedure (also called "SOAPAction"). This parameter is supplied in the documentation of SOAP server. <Encoding style>: Optional character string Encoding style of procedure (also called "EncodingStyle"). This parameter is supplied in the documentation of SOAP server. Remarks Parameters of procedure to run To pass parameters to a procedure executed on a SOAP server, WINDEV uses the following structure: | | | Variable | Type | Details |
---|
SOAP.NameSpace | Optional character string | "NameSpace" of parameter. | SOAP.Name | Character string | Parameter name | SOAP.XMLParam | Optional character string | Full parameter description in XML format. The other parameters (Value, Name, Type, NameSpace and EncodingStyle) are ignored if this parameter is specified. | SOAP.EncodingStyle | Optional character string | Encoding style of parameter. | SOAP.Type | Constant | Type of parameter | SOAP.Value | Any type | Parameter value |
This structure must be used for each parameter. For example:
SOAP.Value[1] = 94010 SOAP.Name[1] = "ZipCode" SOAP.Type[1] = SOAPStringType
This structure is equivalent to:
SOAP.XMLParam[1] = <ZipCode xsi:type="xsd:string">94010</ZipCode>
The type of parameter can be: | | Constant | Type |
---|
SOAPBase64BinaryType | Binary | SOAPHexBinaryType | Hexadecimal binary | SOAPBooleanType | Boolean | SOAPStringType | Character string | SOAPNormalizedStringType | Character string without carriage return (CR) and without tabulation (TAB) | SOAPDecimalType | Any number without limit | SOAPIntType | Integer included between - 2 147 483 648 and + 2 147 483 647) | SOAPShortType | Short integer | SOAPUnsignedShortType | Unsigned short integer | SOAPIntegerType | Integer (no limit) | SOAPLongType | Long integer | SOAPUnsignedLongType | Long unsigned integer | SOAPNegativeIntegerType | Negative integer (except 0) | SOAPNonNegativeIntegerType | Non-negative integer | SOAPNonPositiveIntegerType | Non-positive integer | SOAPUnsignedIntType | Unsigned integer | SOAPPositiveIntegerType | Positive integer (except 0) | SOAPByteType | Byte | SOAPUnsignedByteType | Unsigned byte | SOAPFloatType | Real | SOAPDoubleType | Double real | SOAPAnyURIType | URL address |
After the call to SOAPRun: - The procedure parameters are deleted.
- The structure of the header specified with SOAPAddHeader is deleted.
- SOAPGetResult returns the result of the procedure run.
- SOAPError returns the error message of the procedure run.
SOAPRun returns False if no communication was established with the SOAP server. To get more details on the error, use ErrorInfo with the errMessage constant. Caution: SOAPRun can return False with a correct result if this one contains the ":fault" text. Special case: "405 Method not allowed" error This error means that the "/.soap" string is missing at the end of the URL of the SOAP server powered by WINDEV. This error can also occur if the Web server is not configured to use the WINDEV SOAP server.
This page is also available for…
|
|
|
|