ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
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
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
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.
Warning This function can only be used in a WINDEV application of the "SOAP Server" type.
Example
RETURN SOAPEncodeResult(5, SOAPIntType)
// Idem que RENVOYER 5 utilisé dans le code du serveur SOAP.

RETURN SOAPEncodeResult(maVariable, "montype")
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 "Chaîne résultat"
To return specific types (different from WINDEV types), use SOAPEncodeResult.
For example:
RETURN SOAPEncodeResult(5, SOAPIntType, "urn:monNameSpace")
Remark: The following line of code:
SOAPEncodeResult("valeur", "type", "espace", "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.
    Attention: XML is case-sensitive: only the tag </return> in lowercase 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:
ConstantType
SOAPBase64BinaryTypeBinary
SOAPHexBinaryTypeHexadecimal binary
SOAPBooleanTypeBoolean
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)
SOAPByteTypeByte
SOAPUnsignedByteTypeUnsigned byte
SOAPFloatTypeReal
SOAPDoubleTypeDouble real
SOAPAnyURITypeURL address
Component: wd300com.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help