Help / WLanguage / WLanguage functions / Communication / SOAP
  • Returning a value from a WINDEV SOAP server to a SOAP client
  • Returning a result without encoding it
  • Preset SOAP types
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
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")
<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.

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 "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>

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:
SOAPHexBinaryTypeHexadecimal binary
SOAPStringTypeCharacter string
SOAPNormalizedStringTypeCharacter string without carriage return (CR) and without tabulation (TAB)
SOAPDecimalTypeAny number without limit
SOAPIntTypeInteger included between - 2 147 483 648 and + 2 147 483 647)
SOAPShortTypeShort integer
SOAPUnsignedShortTypeUnsigned short integer
SOAPIntegerTypeInteger (no limit)
SOAPLongTypeLong integer
SOAPUnsignedLongTypeLong unsigned integer
SOAPNegativeIntegerTypeNegative integer (except 0)
SOAPNonNegativeIntegerTypeNon-negative integer
SOAPNonPositiveIntegerTypeNon-positive integer
SOAPUnsignedIntTypeUnsigned integer
SOAPPositiveIntegerTypePositive integer (except 0)
SOAPUnsignedByteTypeUnsigned byte
SOAPDoubleTypeDouble real
SOAPAnyURITypeURL address
Component: wd290com.dll
Minimum version required
  • Version 9
This page is also available for…
Click [Add] to post a comment

Last update: 06/21/2023

Send a report | Local help