ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Communication / J2EE functions
  • Parameters of the procedure to be executed
  • Type of parameter
  • Call to J2EERun
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Runs a procedure on a server of J2EE XML web services.
Note: Procedure parameters must be specified before using the J2EERun function, using the J2EE structure (see Notes).
Example
// Cet exemple est basé sur la présence du module Text2Image Webservice
// sur le site dwdemos.alphaworks.ibm.com. 
// Si le module n'était plus disponible sur le site, 
// l'exemple ne fonctionnerait plus
// Paramètres à passer au service
// Largeur de l'image
J2EE.Value[1] = SAI_LARGEUR
J2EE.Name[1] = "ImageWidth"
J2EE.Type[1] = J2EEIntType
...
// Interrogation du Webservice sur le serveur Web
IF J2EERun(...
	"http://dwdemos.alphaworks.ibm.com:8085/soap/servlet/rpcrouter", ...
	"createImage", "urn:text2image", ...
	"http://alphaworks.ibm.com/alphabeans/text2image/createImage/") THEN
	// Le résultat est une image, on en fait un fichier temporaire
	nIDFic is int
	nIDFic = fOpen(fExeDir() + "\temp.gif", foCreate)
	fWrite(nIDFic, J2EEGetResult(J2EEResult))
	fClose(nIDFic)
	// Affichage
	IMG_GEN = ""
	IMG_GEN = fExeDir() + "\temp.gif"
	// Suppression du fichier temporaire
	fDelete(IMG_GEN)
ELSE
	// Si le service ne retourne pas d'erreur (ex : Serveur inaccessible)
	IF J2EEError(J2EEErrMessage) ~= "" THEN
		Error(ErrorInfo()) 
		// Si le service a retourné une erreur (erreur du service)
	ELSE
		Error("Erreur J2EE : " + J2EEError(J2EEErrMessage))
	END
END
Syntax
<Result> = J2EERun(<Server URL> , <Procedure name> [, <Procedure Namespace> [, <Procedure action> [, <Encoding style>]]])
<Result>: Boolean
  • True if the communication was established with the server,
  • False otherwise (no communication was established). To get more details on the error, use ErrorInfo with the errMessage constant.
<Server URL>: Character string
URL of server to contact. This parameter is supplied in the documentation of server of J2EE XML web services.
<Procedure name>: Character string
Name of the procedure that will be run on the specified server. This parameter is supplied in the documentation of server of J2EE XML web services.
Make sure to respect the case (lowercase/uppercase characters) in the name of the procedure.
<Procedure Namespace>: Optional character string
Namespace of procedure to run. This parameter is supplied in the documentation of server of J2EE XML web services.
<Procedure action>: Optional character string
Action of procedure (also called "J2EEAction"). This parameter is supplied in the documentation of server of J2EE XML web services.
<Encoding style>: Optional character string
Encoding style of procedure (also called "EncodingStyle"). This parameter is supplied in the documentation of server of J2EE XML web services.
Remarks

Parameters of the procedure to be executed

To pass parameters to a procedure run on a server of J2EE XML web services, the following structure is used by WINDEV:
VariableTypeDetails
J2EE.NameSpaceOptional character string"NameSpace" of parameter.
J2EE.NameCharacter stringName of parameter.
J2EE.XMLParamOptional character stringFull parameter description in XML format. The other parameters (Value, Name, Type, NameSpace and EncodingStyle) are ignored if this parameter is specified.
J2EE.EncodingStyleOptional character stringEncoding style of parameter.
J2EE.TypeConstantType of parameter
J2EE.ValueAny typeValue of parameter.

This structure must be used for each parameter. For example:
J2EE.Value[1] = 94010
J2EE.Name[1] = "ZipCode"
J2EE.Type[1] = J2EEStringType
This structure is equivalent to:
J2EE.XMLParam[1] = <ZipCode xsi:type="xsd:string">94010</ZipCode>

Type of parameter

The type of parameter can be:
ConstantType
J2EEBase64BinaryTypeBinary
J2EEHexBinaryTypeHexadecimal binary
J2EEBooleanTypeBoolean
J2EEStringTypeCharacter string
J2EENormalizedStringTypeCharacter string without carriage return (CR) and without tabulation (TAB)
J2EEDecimalTypeAny number without limit
J2EEIntTypeInteger included between - 2 147 483 648 and + 2 147 483 647)
J2EEShortTypeShort integer
J2EEUnsignedShortTypeUnsigned short integer
J2EEIntegerTypeInteger (no limit)
J2EELongTypeLong integer
J2EEUnsignedLongTypeLong unsigned integer
J2EENegativeIntegerTypeNegative integer (except 0)
J2EENonNegativeIntegerTypeNon-negative integer
J2EENonPositiveIntegerTypeNon-positive integer
J2EEUnsignedIntTypeUnsigned integer
J2EEPositiveIntegerTypePositive integer (except 0)
J2EEByteTypeByte
J2EEUnsignedByteTypeUnsigned byte
J2EEFloatTypeReal
J2EEDoubleTypeDouble real
J2EEAnyURITypeURL address

Call to J2EERun

After the call to J2EERun:
  • The procedure parameters are deleted.
  • The structure of the header specified with J2EEAddHeader is deleted.
  • J2EEGetResult returns the result of the procedure run.
  • J2EEError returns the error message of the procedure run.
Component: wd300com.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/28/2025

Send a report | Local help