• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Error Csnet Read Operation Failed (winsock Reported Error=0) (11773)

#1
Hello everybody, good afternoon!

Have version OpenEdge 11.6.3, 03 HOTFIXES.

I'm trying to run the code below:

CREATE SERVER hWebService.
hWebService:CONNECT("-WSDL 'https://preproducao.roadcard.com.br/sistemapamcard/services/WSTransacional?WSDL'
-Port WSTransacional
-sslAuth ssl
-sslKeyFile C:\temp\pamcard\host2017.pfx
-sslKeyPwd hjbg374489").
RUN WSTransacional SET hWSTransacional ON hWebService.

RUN EXECUTE IN hWSTransacional (INPUT lcInput, OUTPUT lcOutput).

And I am getting the following error:

Error receiving Web Service Response: Fatal Error: csnet read operation failed (WinSock reported error=0) (11773)

The error occurs when we execute this line of code:

RUN EXECUTE IN hWSTransacional (INPUT lcInput, OUTPUT lcOutput).

Anyone know tell me how can I solve?
Thank you
 

Cecil

17+ years progress programming and still learning.
#3
Looking at the documentation, I think you are missing the DATASET parameter:

Are you passing a LONGCHAR variable where it's context is an XML string or are you passing in a DATASET?


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

DEFINE TEMP-TABLE arg0 NO-UNDO
    NAMESPACE-URI ""
    FIELD context AS CHARACTER .

DEFINE TEMP-TABLE fields1 NO-UNDO
    NAMESPACE-URI ""
    XML-NODE-NAME "fields"
    FIELD key AS CHARACTER
    FIELD value1 AS CHARACTER
        XML-NODE-NAME "value"
    FIELD arg0_id AS RECID
        XML-NODE-TYPE "HIDDEN" .HIDDEN" .

DEFINE DATASET execute NAMESPACE-URI "http://webservice.pamcard.jee.pamcary.com.br"
    FOR arg0, fields1
    PARENT-ID-RELATION RELATION1 FOR arg0, fields1
        PARENT-ID-FIELD arg0_id.

DEFINE TEMP-TABLE return1 NO-UNDO
    NAMESPACE-URI ""
    XML-NODE-NAME "return"
    FIELD return1_field AS INTEGER
        XML-NODE-TYPE "HIDDEN" .HIDDEN" .

DEFINE TEMP-TABLE fields1 NO-UNDO
    NAMESPACE-URI ""
    XML-NODE-NAME "fields"
    FIELD key AS CHARACTER
    FIELD value1 AS CHARACTER
        XML-NODE-NAME "value"
    FIELD return1_id AS RECID
        XML-NODE-TYPE "HIDDEN" .HIDDEN" .

DEFINE DATASET executeResponse NAMESPACE-URI "http://webservice.pamcard.jee.pamcary.com.br"
    FOR return1, fields1
    PARENT-ID-RELATION RELATION1 FOR return1, fields1
        PARENT-ID-FIELD return1_id.

CREATE SERVER hWebService.hWebService

hWebService:CONNECT("-WSDL 'https://preproducao.roadcard.com.br/sistemapamcardwsdl/WSTransacional-wsdl.xml?WSDL'").

RUN WSTransacional SET hWSTransacional ON hWebService.hWebService.

RUN execute IN hWSTransacional(INPUT DATASET execute, OUTPUT DATASET executeResponse).
 
Last edited:
#4
I tried to use this template but how do I send the DATASET run with the data for the search? I create the record in the fields1 table?
The DATASET run is INPUT, and note that the temp-table fieldes1 is set 2 times.

Tanks
 

Cecil

17+ years progress programming and still learning.
#5
Okay,... I see that the WSDL analyzer tool has generated two temp-tables with the same name which is causing a bit of confusion.

I have refactored the code (see Below) and I have also included -SOAPEndpoint parameter.

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

&SCOPED-DEFINE xFormated TRUE 

/** REQUEST Group. START**/

DEFINE TEMP-TABLE arg0 NO-UNDO
    NAMESPACE-URI ""
    FIELD context AS CHARACTER XML-NODE-NAME "context".

DEFINE TEMP-TABLE fieldsRequest NO-UNDO
    NAMESPACE-URI ""
    XML-NODE-NAME "fields"
    FIELD key       AS CHARACTER XML-NODE-NAME "key"
    FIELD value1    AS CHARACTER XML-NODE-NAME "value"
    FIELD arg0_id   AS RECID     XML-NODE-TYPE "HIDDEN" .

DEFINE DATASET executeRequest NAMESPACE-URI "http://webservice.pamcard.jee.pamcary.com.br"
    XML-NODE-NAME "execute"
    FOR arg0, fieldsRequest
    PARENT-ID-RELATION RELATION1 FOR arg0, fieldsRequest
        PARENT-ID-FIELD arg0_id.
      
/** REQUEST Group.. END**/

/** RESPOUNCE Group.. START**/

DEFINE TEMP-TABLE returnResponce NO-UNDO
    NAMESPACE-URI ""
    XML-NODE-NAME "return"
    FIELD return1_field AS INTEGER XML-NODE-TYPE "HIDDEN" .

DEFINE TEMP-TABLE fieldsResponce NO-UNDO
    NAMESPACE-URI ""
    XML-NODE-NAME "fields"
    FIELD key           AS CHARACTER    XML-NODE-NAME "key"
    FIELD value1        AS CHARACTER    XML-NODE-NAME "value"
    FIELD return1_id    AS RECID        XML-NODE-TYPE "HIDDEN" .

DEFINE DATASET executeResponse
    NAMESPACE-URI "http://webservice.pamcard.jee.pamcary.com.br"
    XML-NODE-NAME "executeResponse"
    FOR returnResponce, fieldsResponce
    PARENT-ID-RELATION RELATION1 FOR returnResponce, fieldsResponce
        PARENT-ID-FIELD return1_id  .

/** RESPOUNCE Group.. END**/


CREATE SERVER hWebService.

hWebService:CONNECT("-WSDL 'https://preproducao.roadcard.com.br/sistemapamcardwsdl/WSTransacional-wsdl.xml?WSDL'
                     -SOAPEndpoint https://preproducao.roadcard.com.br/sistemapamcardwsdl/WSTransacional-wsdl.xml").

RUN WSTransacional SET hWSTransacional ON hWebService.     
      
/*** Create

Create the necessary Temp-tables here.

****/

      
/** debug**/     
DATASET executeRequest:WRITE-XML("file",SESSION:TEMP-DIRECTORY + "/executeRequest.xml":U, {&xFormated} ). 
      
RUN execute IN hWSTransacional(INPUT  DATASET executeRequest,
                               OUTPUT DATASET executeResponse).

/** debug**/     
DATASET executeRequest:WRITE-XML("file",SESSION:TEMP-DIRECTORY + "/executeResponse.xml":U, {&xFormated} ). 

/** Garbage collection is needed here. i.e. DELETE OBJECT hWebService.**/
 
Last edited: