WSDL operation call

John

Member
Hello,

Below is the signature of operation in WSDL: RUN pProc IN hPortType(INPUT req, OUTPUT Res).

I'm writing below code to call pProc asynchronously :
Code:
    RUN pProc IN hPortType (INPUT iReq, OUTPUT opRes)
       ASYNCHRONOUS  SET hRoundtrip EVENT-PROCEDURE "eHandler"   NO-ERROR. 


PROCEDURE eHandler:
    MESSAGE "IN PROCEDURE eHandler"   VIEW-AS ALERT-BOX INFO BUTTONS OK.
    lCallback = TRUE. /* This variable is defined in definition section at the top of program */
END.
But I am getting compilation error. Please suggest how should this be?

Regards
 
Last edited by a moderator:

Cringer

ProgressTalk.com Moderator
Staff member
What's the compile error?
A vague bell tells me it should be something like:
ASYNCHRONOUS SET hRoundtrip EVENT-PROCEDURE "eHandler" PERSISTENT NO-ERROR.
 

andre42

Member
The compile error I get is
** Invalid keyword found. Enclose it in quotes: ASYNCHRONOUS. (349)
According to the OpenEdge Help the parameters go last, just before NO-ERROR. These RUN statement compiles:
Code:
    RUN pProc IN hPortType
       ASYNCHRONOUS  SET hRoundtrip EVENT-PROCEDURE "eHandler"
       (INPUT iReq, OUTPUT opRes) NO-ERROR.
 

Cecil

19+ years progress programming and still learning.
Unless you are using an AppServer I don't think you will need to be using an 'ASYNCHRONOUS' option.

When consuming Web Services (WSDL) via the ABL, your code should look something like this:

Code:
DEFINE VARIABLE hWebService AS HANDLE NO-UNDO.
DEFINE VARIABLE hAWSECommerceServicePortType AS HANDLE NO-UNDO.


CREATE SERVER hWebService.


hWebService:CONNECT("-WSDL 'http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl'").

RUN AWSECommerceServicePortType SET hAWSECommerceServicePortType ON hWebService.

DEFINE VARIABLE MarketplaceDomain AS CHARACTER NO-UNDO.
DEFINE VARIABLE AWSAccessKeyId AS CHARACTER NO-UNDO.
DEFINE VARIABLE AssociateTag AS CHARACTER NO-UNDO.
DEFINE VARIABLE XMLEscaping AS CHARACTER NO-UNDO.
DEFINE VARIABLE Validate AS CHARACTER NO-UNDO.
DEFINE VARIABLE Shared1 AS LONGCHAR NO-UNDO.
DEFINE VARIABLE Request AS LONGCHAR EXTENT 100 NO-UNDO.
DEFINE VARIABLE OperationRequest AS LONGCHAR NO-UNDO.
DEFINE VARIABLE Items AS LONGCHAR EXTENT NO-UNDO.


RUN ItemSearch IN hAWSECommerceServicePortType(INPUT MarketplaceDomain, INPUT AWSAccessKeyId, INPUT AssociateTag, INPUT XMLEscaping, INPUT Validate, INPUT Shared1, INPUT Request, OUTPUT OperationRequest, OUTPUT Items).
Use the OpenEdge tool bprowsdldoc to create the ABL documentation.

bprowsdldoc http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl
 

John

Member
Thanks for answering my query.How will we handle time out scenariosif program takes longer time than expected
in following conditions?

1) Conneting Webservie [CONNECT() Statement]
2) Calling operation defined in WSDL

Regards
 

Cecil

19+ years progress programming and still learning.
Thanks for answering my query.How will we handle time out scenariosif program takes longer time than expected
in following conditions?

1) Conneting Webservie [CONNECT() Statement]
2) Calling operation defined in WSDL

Regards
Are you currently having issues when calling Web Services which are taking longer than expecting?
I guess you could call via an Asynconose AppServer call. which will give you distributing processing is this what you are trying to achieve?

Summary:
ABL Client --> AppServer --> WebServices --> AppServer --> ABL Cient.

Good WebServices should be handling requests in a timely fashion manor. It seems that you are having to cater for others imperfections.
 

John

Member
Are you currently having issues when calling Web Services which are taking longer than expecting?
I guess you could call via an Asynconose AppServer call. which will give you distributing processing is this what you are trying to achieve?

Summary:
ABL Client --> AppServer --> WebServices --> AppServer --> ABL Cient.

Good WebServices should be handling requests in a timely fashion manor. It seems that you are having to cater for others imperfections.
Hello Cecil,

We are actually developing new web based application using Webspeed with limited resources. This would be running on intranet. We are not using Appserver and currently not facing any time out issue.

But considering this scenario to handle as we may see some scenario where webservice call/response which may take longer than expected time. Could you please best way to handle this? Thank You.
Regards
 

Cecil

19+ years progress programming and still learning.
Something you could try is to use a STOP-AFTER option on your server-side code. I have never tried it myself but in theory, if you believe that a particular web service request it taking longer than expected you can break out of your loop and return a server 500 error message (or similar).

I guess you have to determine in your server-side code which could cause problems with performance.

Code:
DEFINE VARIABLE ix       AS INTEGER NO-UNDO.

 DEFINE VARIABLE stopTime AS INTEGER NO-UNDO INITIAL 30.

 

DO WHILE TRUE STOP-AFTER stopTime ON STOP UNDO, LEAVE:

   RUN spinHere (10000).

   stopTime = stopTime / 2.

 END.

 MESSAGE "program finished".

 

PROCEDURE spinHere:

   DEFINE INPUT PARAMETER spinLimit AS INT64 NO-UNDO.

 

  DEFINE VARIABLE endTime  AS INT64   NO-UNDO.

   DEFINE VARIABLE loopFlag AS LOGICAL NO-UNDO.

 

  ASSIGN

     loopFlag = TRUE

     endTime  = ETIME(FALSE) + spinLimit.

 

  DO WHILE loopFlag:

     IF (ETIME(FALSE) > endTime) THEN

       loopFlag = FALSE.

   END.

 END PROCEDURE.
An alternative (more complex) is for the web client to issue a call back URL. So, if the serverside process takes a long time WebSpeed Agent makes an HTTP (POST) requests to the passed call-back URL. Clickatell SMS gateway service use to do this to confirm when an SMS message has been successfully sent to a mobile phone.
 
Top