project BLF > class TDocumentLink > method Connect


Internal usage


BLF
method TDocumentLink.CollectionExists
method TDocumentLink.CopyResource
method TDocumentLink.CreateCollection
method TDocumentLink.CreateResource


program code (program1/tdocumentlink.p)

vcWebdavResponse = "".

if vcWebdavHost = ""
or vcWebdavPort = ""
or vcWebdavRoot = "/"
then vcWebdavResponse = #T-52'The configuration for the webdav protocol is incomplete.':255(137512576)T-52#.
else do:
    create socket vhWebdavSocket.
    vhWebdavSocket:set-read-response-procedure ("ReadHandler",{&TARGETPROCEDURE}).
    vlStatus = vhWebdavSocket:connect ("-H " + vcWebdavHost + " -S " + vcWebdavPort) no-error.
    if not vlStatus
    then do:
        vcWebdavResponse = substitute (#T-68'HTTP connection to server &1 on port &2 failed.':255(749790069)T-68#,vcWebdavHost,vcWebdavPort).
        delete object vhWebdavSocket.
        vhWebdavSocket = ?.
    end.
end.