0
我有人問我們是否可以通過網絡服務向客戶提供文件。我們使用Scribe來發送數據到Web服務,但我無法發送附件。任何人都知道我是否可以用SSIS(或其他工具)做這樣的事情:我可以使用SSIS提交文件嗎
這是一種客戶端用來上傳purl更新的方法。這是一個以CSV格式上傳的單個文件,第一行是標題。 的方法需要五(5)參數:
Parameters (1) a string that is the login name.
Parameters (2) a string that is used for the password.
Parameters (3) a string that is used to specify which application.
Parameters (4) a string that is the file name. This is used to identify a specific file upload.
Parameters (5) an array of bytes that is the content of the file.
Parameters (6) an integer that defines the length of the file upload.
RETURNS an integer that will return the number of items successful uploaded or a negative number that returns an error.
Sample:
// Connect to the Web Service
PurlService.ServiceFile service = new PurlService.ServiceFile();
// Test the method
string login = 「mylogin」;
string password = 「mypassword」;
string application = 「FSI」;
string filename = 「myfilename.csv」;
byte [] bytes = new byte[file.ContentLength];
file.InputStream.Read(bytes, 0, file.ContentLength)
int returnValue = service.UploadFile(login, password, application, fileName, bytes, bytes.Length); // If successful, the returnValue will be a text message.