Consultor Eletrônico



Kbase P131500: 4GL/ABL: Can an OpenEdge TTY character client consume WebServices?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   9/18/2009
Status: Verified

GOAL:

4GL/ABL: Can an OpenEdge TTY character client consume WebServices?

GOAL:

WebServices: How can an OpenEdge OpenEdge character client consume public WebServices?

GOAL:

What are the steps involved in writing a 4GL/ABL procedure to consume public WebServices?

GOAL:

Sample code to consume a public WebService from the Microsoft Soap Interop Server.

FACT(s) (Environment):

All Supported Operating Systems
OpenEdge 10.x

FIX:

The following demonstrates how to consume a simple public WebService from the Microsoft Soap Interop Server
1. Use the OpenEdge WSDL Analyzer by executing the bprowsdldoc online ommand utility:
bprowsdldoc http://mssoapinterop.org/stk/Interop.wsdl
2. The following five html WSDL documentation files will be generated:
2.1. index.html
2.2. DataTypes.html
2.3. portType_http___tempuri_org_wsdl__SoapPort.html
2.4. OperationIndex.html
2.5. service_http___tempuri_org_wsdl__Interop.html
3. Use the information and sample code in the above html WSDL documentation files to code 4GL/ABL procedures to connect to the Web Service and invoke its exposed operations.
4. Steps 1 and 2 may be performed on any operating system that has the ability to access Web Services (See the note below on platform availability limitation.) Step 3 may be performed on any platform operating system equipped with a www browser capable of displaying html files.
5. The following sample ABL procedure connects to the above WebService and invokes its echoBoolean operation. This operation simply echoes the Boolean input parameter passed to it back to the client:
DEFINE VARIABLE hWebService AS HANDLE NO-UNDO.
DEFINE VARIABLE hSoapPort AS HANDLE NO-UNDO.
/* Connect to the WebService */
CREATE SERVER hWebService.
hWebService:CONNECT("-WSDL 'http://mssoapinterop.org/stk/Interop.wsdl'").
RUN SoapPort SET hSoapPort ON hWebService.
/* Invoke its echoBoolean method */
DEFINE VARIABLE inputBoolean AS LOGICAL NO-UNDO.
DEFINE VARIABLE return1 AS LOGICAL NO-UNDO.
ASSIGN
inputBoolean = TRUE.
/* Procedure invocation of echoBoolean operation. */
RUN echoBoolean IN hSoapPort(INPUT inputBoolean, OUTPUT return1).
MESSAGE return1
VIEW-AS ALERT-BOX INFO BUTTONS OK.
ASSIGN
inputBoolean = FALSE.
/* Procedure invocation of echoBoolean operation. */
RUN echoBoolean IN hSoapPort(INPUT inputBoolean, OUTPUT return1).
MESSAGE return1
VIEW-AS ALERT-BOX INFO BUTTONS OK.