I am trying to do an integration testing with PB 12.5.2 and some APIs. I have managed to make it work on the client server version but can't seem to make it work after deploying to Appeon (EAServer) Appeon for PowerBuilder 2013 R2 Build 0126.00 . I just get a blank return when running the application from the Appeon Server.
I read Appeon supports OLEObject. Are there any dlls I should be deploying as part of the application deployment to make this work? Not sure what I am missing and couldn't find and documentation about this. Appreciate any help
GET:
integer li_rc, ll_status_code
string ls_return, ls_status_text, ls_response_text
OLEObject PBObject
PBObject = Create OLEObject
PBObject.ConnectToNewObject("Msxml2.XMLHTTP.6.0")
PBObject.OPEN ("GET" , "https://jsonplaceholder.typicode.com/posts/2",FALSE)
PBObject.send()
//Get response
ls_status_text = PBObject.StatusText
ll_status_code = PBObject.Status
ls_response_text = PBObject.ResponseText
POST:
string ls_args, ls_headers_content_type, ls_return, ls_status_text, ls_response_text
OLEObject PBObject
PBObject = Create OLEObject
PBObject.ConnectToNewObject("Msxml2.XMLHTTP.6.0")
PBObject.OPEN ("POST" , "https://reqres.in/api/users", FALSE)
ls_headers_content_type = "application/json"
PBObject.setRequestHeader("Content-Type", ls_headers_content_type)
ls_args = '{"name":"test","job":"leader"}'
PBObject.send(ls_args)
ls_status_text = PBObject.StatusText
ll_status_code = PBObject.Status
ls_response_text = PBObject.ResponseText
Thanks for the response. I updated my deployment project type to use Web and it worked! It was initially set to Universal. Thanks again!