testGet <- function(url = "TimeService/TimeService.asmx", host = "www.nanonull.com", action = "http://www.Nanonull.com/TimeService/getTimeZoneTime", debug = FALSE, method = "getTimeZoneTime", ...) { if(debug) con <- textConnection(".SOAPTest", open="w") else { con <- socketConnection(host, port = 80, open = "w+", blocking = TRUE) on.exit(close(con)) } cat("GET /", url, "/", method, file=con, sep="") args <- list(...) for(i in names(args)) cat("?", i, "=", args[[i]], file=con, sep="") cat(" HTTP/1.1\n", sep="", file=con) cat("Host: www.nanonull.com\n\n\n\n", file=con) if(debug) { close(con) return(paste(get(".SOAPTest"), collapse="\n")) } txt <- readLines(con) txt } # "urn:soapinterop" # '', # 'DIS', # '', test <- function(url = "TimeService/TimeService.asmx", host = "www.nanonull.com", action = "http://www.Nanonull.com/TimeService/getTimeZoneTime", debug = FALSE, ...) { # If debugging, use a text connection and write the HTTP request # to that, and then return. if(debug) con <- textConnection(".SOAPTest", open="w") else { con <- socketConnection(host, port = 80, open = "w+", blocking = TRUE) on.exit(close(con)) } # The HTTP request header information writeSOAPHeader(url, host, action, con) # The basic SOAP envelope writeSOAPEnvelope(con, SOAPNameSpaces) cat('\n', file=con) # cat('\n',file=con) cat('GMT\n',file=con) cat('\n', file = con) cat("\n", file=con) cat("\n", file=con) cat("\n\n", file=con) if(debug) { close(con) return(paste(get(".SOAPTest"), collapse="\n")) } # Now read the response from the server. txt <- readLines(con) # Parse this into content <- getHTTPContent(txt) content }