We have written OScript below which sends the Disposition Status change to a custom web service. Our web service recieves the call but the Oscript method never recieves a response and hangs (Processing window on disposition screen remains).
Is there something else we need to add to our code?
Any help on this would be appreciated. We've removed our server addresses but the rest of the code is what we've been running.
Thanks
Mike
function Assoc CBDispStatusChangePre( \
Object prgCtx, \
DAPINODE node, \
Assoc actionInfo )
Assoc rtnVal
String errMsg
Dynamic apiError
Boolean ok = true
String url
String contentType
String contentLength
String data
String host
Socket sock
String result
sock = Socket.Create()
sock.pBlocking = true
Socket.Connect(sock, "WebServer", 8090)
url = Str.Format("GET /WebService/rest/doAction/%1/%2 HTTP/1.1", node.pID, actionInfo.newStatus)
host = "Host: WebServer:8090"
contentType = "Content-Type: text/xml;charset=utf-8"
data = ""
contentLength = Str.Format("Content-Length: %1", Length(data))
Socket.write(sock, url + Web.CRLF);
Socket.write(sock, host + Web.CRLF);
Socket.write(sock, contentType + Web.CRLF);
Socket.write(sock, contentLength + Web.CRLF);
Socket.write(sock, Web.CRLF);
Socket.write(sock, data + Web.CRLF);
Socket.Flush(sock)
// result = Socket.Read(sock) <--- issue is here!
// Echo(result)
Socket.Close(sock)
if IsUndefined( rtnVal.OK )
rtnVal.OK = ok
rtnVal.ErrMsg = errMsg
rtnVal.ApiError = apiError
end
return rtnVal
end