Меня спрашивали, можем ли мы предоставить файл клиенту через веб-службы. Мы много используем Scribe для отправки данных в веб-службы, но я не могу отправлять вложения. Кто-нибудь знает, могу ли я сделать что-то подобное с помощью 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.