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
  • The different types of results
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Returns the result of the last J2EE procedure that was successfully run.
Note This procedure was carried out by function J2EERun or J2EERunXML.
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
// 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> = J2EEGetResult(<Type of result> [, <Result Number>])
<Result>: Character string
  • Result of the last J2EE procedure successfully run.
  • If several results are returned by the server and if the J2EEResult constant is used:
    • result <Result Number>,
    • first result returned if <Result Number> is not specified.
  • An empty string ("") if:
    • no result was returned by the server,
    • no connection was established with the server.
<Type of result>: Constant
Type of result to return:
J2EEHTTPResultResult (in HTTP format) of the last J2EE procedure run.
J2EEResultResult of the last J2EE procedure run.
J2EEXMLResultResult (in XML format) of the last J2EE procedure run.
<Result Number>: Optional integer
Number of the result to return. This parameter is used only if several results are returned by the server and if the J2EEResult constant is specified. Otherwise, this parameter is ignored.
Remarks

The different types of results

The same procedure run on a server can return three types of results.
Consider the following example:
The "getTemp" procedure (used to find out the temperature of a city) has been run. The types of results returned by J2EEGetResult are as follows:
  • With constant J2EERresult: 37
  • With the J2EEHTTPResult constant:
    HTTP/1.1 200 OK
    Date: Mon, 09 Jul 2001 09:34:49 GMT
    Status: 200
    Set-Cookie2: JSESSIONID=To16135mC022383577812008837At;Version=1;Discard;Path="/soap"
    Servlet-Engine: Tomcat Web Server/3.1 (JSP 1.1; Servlet 2.2; Java 1.3.0;
    Linux 2.2.19-6.2.1.2RS x86; java.vendor=IBM Corporation)
    Set-Cookie: JSESSIONID=To16135mC022383577812008837At;Path=/soap
    Content-Type: text/xml; charset=utf-8
    Content-Length: 467
    Content-Language: en
    <?xml version='1.0' encoding='UTF-8'?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/1999/XMLSchema">
    <SOAP-ENV:Body>
    <ns1:getTempResponse xmlns:ns1="urn:xmethods-Temperature"
    SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <return xsi:type="xsd:float">'''37.0'''</return>
    </ns1:getTempResponse>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
  • With the J2EEXMLResult constant:
    <?xml version='1.0' encoding='UTF-8'?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/1999/XMLSchema">
    <SOAP-ENV:Body>
    <ns1:getTempResponse xmlns:ns1="urn:xmethods-Temperature"
    SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <return xsi:type="xsd:float">'''37.0'''</return>
    </ns1:getTempResponse>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
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