网络传输问题
void Copy::startUploading(){ connect(&httpCopyUpload , SIGNAL(responseReady()) , this , SLOT(getUploadResponse())); connect(&httpCopyUpload , SIGNAL(responseError()) , this , SLOT(errorUploadResponse())); QString strFilePathName = "/root/file.tgz"; QByteArray filebyte = ""; QFile fileTar(strFilePathName); if (!fileTar.open(QIODevice::ReadOnly)) { fileTar.close(); return; } else { filebyte = fileTar.readAll(); fileTar.close(); } QString encodedstring = filebyte.toBase64(); QString strIp = getElementText("ServerIP"); QString strPort = getElementText("ServerPort"); httpCopyUpload.setAction("http://tempuri.org/UploadFileByByte"); httpCopyUpload.setHost(strIp,strPort.toInt()); QtSoapMessage request; request.setMethod("UploadFileByByte" , "http://tempuri.org/"); request.addMethodArgument("fileName" , "" ,"file.tgz"); request.addMethodArgument("fileId" , "" , ""); request.addMethodArgument("fileByte" , "" ,encodedstring); request.addMethodArgument("isFirst" , "" , "true"); request.addMethodArgument("isLast" , "" , "true"); request.addMethodArgument("fileMD5" , "" , ""); httpCopyUpload.submitRequest(request , "/Services/FileOperationWebService.asmx");}