[stackoverflow] [progress Openedge Abl] How To Pass Table As Input Parameter To Web Service?

  • Thread starter Thread starter KuKeC
  • Start date Start date
Status
Not open for further replies.
K

KuKeC

Guest
I am invoking methods of WSDL in Progress Openedge. So far i don't have problems invoking "GET" methods where i just need to pass password. The problem is when i need to use "SET" methods which needs password + some data stored in temp-tables. So far i have searched and found nothing that could help me. Below is code which works for calling GET methods.

DEFINE VARIABLE hWebService AS HANDLE NO-UNDO.
DEFINE VARIABLE hServiceSoap AS HANDLE NO-UNDO.
DEFINE VARIABLE symbol AS CHARACTER NO-UNDO.
DEFINE VARIABLE resp AS CHARACTER NO-UNDO.

define variable xmlCHar as longchar no-undo.

CREATE SERVER hWebService.
hWebService:CONNECT("-WSDL 'url_of_my_wsdl'").
IF NOT hWebService:CONNECTED() THEN DO:
MESSAGE "SERVER: " SKIP "url_of_my_wsdl" SKIP
"is not connected"
VIEW-AS ALERT-BOX INFO BUTTONS OK.
RETURN.
END.

RUN GET_smth_or_SET_smth SET hServiceSoap ON hWebService.

IF NOT VALID-HANDLE(hServiceSoap) THEN DO:
MESSAGE "PortType: " VALID-HANDLE(hServiceSoap) " is not valid"
VIEW-AS ALERT-BOX INFO BUTTONS OK.
RETURN.
END.

/* password/key */
symbol = "1234asasdas".

RUN SetERPSavedStatus IN hServiceSoap(INPUT symbol, OUTPUT resp).

IF ERROR-STATUS:ERROR THEN DO:
DEFINE VARIABLE iCnt AS INTEGER NO-UNDO.
DO iCnt = 1 TO ERROR-STATUS:NUM-MESSAGES:
MESSAGE ERROR-STATUS:GET-MESSAGE(iCnt)
VIEW-AS ALERT-BOX INFO BUTTONS OK.
END.

IF VALID-HANDLE(ERROR-STATUS:ERROR-OBJECT-DETAIL) THEN DO:
DEFINE VARIABLE hXML AS HANDLE NO-UNDO.
DEFINE VARIABLE mDoc AS MEMPTR NO-UNDO.
CREATE X-DOCUMENT hXML.
hXML:LOAD('LONGCHAR', ERROR-STATUS:ERROR-OBJECT-DETAIL:SOAP-FAULT-DETAIL:GET-SERIALIZED(), FALSE).
hXML:SAVE("memptr", mDoc).
MESSAGE "Fault Code : " ERROR-STATUS:ERROR-OBJECT-DETAIL:SOAP-FAULT-CODE SKIP
"Fault String: " ERROR-STATUS:ERROR-OBJECT-DETAIL:SOAP-FAULT-STRING SKIP
"Fault Actor : " ERROR-STATUS:ERROR-OBJECT-DETAIL:SOAP-FAULT-ACTOR SKIP
"Error Type : " ERROR-STATUS:ERROR-OBJECT-DETAIL:TYPE SKIP SKIP
"Fault Detail: " SKIP GET-STRING(mDoc,1)
VIEW-AS ALERT-BOX INFO BUTTONS OK.
END.
END.

/* display of respond*/
MESSAGE resp
VIEW-AS ALERT-BOX INFO BUTTONS OK.

DELETE OBJECT hServiceSoap.
hWebService:DISCONNECT().
DELETE OBJECT hWebService.


What do i need to change/improve to send with my password data in temp table? When i run this code for GET methods, it works. When i use it for SET methods then i get message

Any help would be nice.

Continue reading...
 
Status
Not open for further replies.
Back
Top