|
|
|
|
|
- Returning a value from a WINDEV SOAP server to a SOAP client
- Returning a result without encoding it
- Preset SOAP types
SOAPEncodeResult (Function) In french: SOAPEncodeRésultat Allows you to configure the format of the value returned by the WINDEV SOAP server to the SOAP client program. By default, the WINDEV SOAP server returns simple data only (character string, integer, boolean, ...). SOAPEncodeResult returns SOAP-specific types to the SOAP client. Caution: This function can only be used in a WINDEV "SOAP Server" application. RETURN SOAPEncodeResult(5, SOAPIntType) // Same as RETURN 5 used in the code of the SOAP server.  RETURN SOAPEncodeResult(myVariable, "mytype") Syntax
<Result> = SOAPEncodeResult(<Value to encode> , <Type> [, <Namespace> [, <Encoding style>]])
<Result>: Character string Value encoded according to the specified parameters. <Value to encode>: Character string Value to encode according to the specified parameters. <Type>: Constant or character string Type of the result to return. Can be:- a character string used to specify a specific type.
- a preset SOAP type (see the notes)
<Namespace>: Optional character string Namespace of the value to return. <Encoding style>: Optional character string Encoding style of the value (also called "EncodingStyle"). This parameter can correspond to any namespace defined in the WSDL. Remarks Returning a value from a WINDEV SOAP server to a SOAP client By default, to return a value from a WINDEV SOAP server, the RESULT keyword can be used in the different functions of the SOAP server. For example: RETURN 5 RETURN "Result String" To return specific types (different from WINDEV types), use SOAPEncodeResult. For example: RETURN SOAPEncodeResult(5, SOAPIntType, "urn:myNameSpace") Remark: The following line of code: SOAPEncodeResult("value", "type", "space", "style") generates a response envelope such as: <PROJECTNAMEResponse xmlns="namespace of PROJECTNAMEResponse" SOAP-ENV:encodingStyle="style"> <PROJECTNAMEResult xmlns:ns2="style" xsi:type="ns2:type">value</PROJECTNAMEResult> </PROJECTNAMEResponse> Returning a result without encoding it When SOAPEncodeResult is used on a WINDEV SOAP server, it returns an "encoded" result. However, a string can be returned directly without being encoded. In this case, the XML string must be valid and it must contains one of the two substrings below: - "xmlns:"
- </return>. In this case, the XML code must be enclosed between <return> and </return>. These tags must be removed when receiving the result.
Caution: The XML is case sensitive: only the </return> tag in lowercase characters is recognized.
On the client side, you must use SOAPGetResult associated with the SOAPXMLResult constant. Preset SOAP types The SOAP types that can be used are: | | 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 |
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|