weird behaviour on webservice (using the OpenEdge.Net.pl lib

Posted by karine laporte on 15-Jun-2017 04:31

Hi,

 

We are trying to call a webservice using the OpenEdge.Net.pl library.

The following code works except for one production environnement where we have a weird behaviour.

There are no error, we have a valid oResponse object but it is empty.

oResponse:StatusReason is empty and oResponse:StatusCode = 0 ?

 

When does StatusCode=0 ? and why ?

How should we handle such return value ?

 

 

oResponse = ClientBuilder:Build()

:Client

                :Execute(oRequest)

                no-error.

if error-status:error

then do :

                put stream debug-log unformatted "ERROR ClientBuilder " skip.

                do ix = 1 to error-status:num-messages :

                               put stream debug-log unformatted "ERROR " error-status:get-number(ix) error-status:get-message(ix) skip.

                end.

                return.

end.

 

if not valid-object ( oResponse )

then do:

                put stream debug-log unformatted "ERROR sending POST request to URI : " + x-uri + " invalid response object " skip.

end.

else do :

                put stream debug-log unformatted "Request response " oResponse:StatusReason " - " oResponse:StatusCode skip.

end.

All Replies

Posted by Peter Judge on 26-Jun-2017 15:35

You will always see a message body  (except for non-HEAD requests in 11.7.1+)

Are you seeing errors? Also, you can enable more logging via the LOG-MANAGER, with code similar to the below. It might give you a clue.

log-manager:logfile-name = session:temp-dir + 'http_client.log'. 
log-manager:logging-level = 5.
log-manager:clear-log ().

This thread is closed