S
susinmn
Можно ли через Web-сервис втянуть файл, ну и прикрепить его к документу?
Подскажите в какую сторону копнуть
Подскажите в какую сторону копнуть
http://www.ibm.com/developerworks/lotus/library/web-services3/
Sub Initialize
Dim wsdl As String
Dim client As Variant
Dim result As Variant
Dim result2 As Variant
Dim startTime As Single
Dim endTime As Single
'** create the MSSOAP object, based on our WSDL file
startTime = Timer
wsdl = "http://test.server/WSBookstore.nsf/BookDownloadUpload?WSDL"
'** try to use MSSOAP 3.0, if available
On Error Resume Next
Set client = CreateObject("MSSOAP.SoapClient30")
On Error Goto processError
'** if not, use whatever version is on the workstation
If (Err > 0) Then
Err = 0
Set client = CreateObject("MSSOAP.SoapClient")
End If
Call client.MSSoapInit(wsdl)
'** call the GetFirstTitleMatch method (note that MSSOAP is
'** NOT case-sensitive with the method names)
Set result = client.getFirstTitleMatch("T")
endTime = Timer
Print "Total elapsed time: " & Fix((endTime - startTime) * 1000) & " milliseconds"
'================================
Dim session As New NotesSession
Dim fileIN As NotesStream
Set fileIN = session.CreateStream
If Not fileIN.Open("c:\teete.txt","Binary") Then
Msgbox "Cannot open teete.txt", , "Error"
Exit Sub
End If
If fileIN.Bytes = 0 Then
Msgbox "File did not exist or was empty", , "teete.txt"
Exit Sub
End If
Set result2 = client.addNewFile("test","Test","description one sdfasf", "Reference", "teete.txt",fileIN)
'==========================================з
Public Function addNewFile (title As String, author As String, description As String, _
typeOfBook As BookType, fileName As String, base64file As XSD_BASE64BINARY, _
returnFault As WS_FAULT) As String
Dim book As New BookInfoAndFile
book.title = title
book.author = author
Set book.typeOfBook = typeOfBook
book.description = description
book.fileName = fileName
Set book.base64file = base64file
addNewFile = addNewFileComplex(book, returnFault)
End Function
The following LotusScript XSD classes are proxy classes: XSD_BASE64BINARY, XSD_DATE, XSD_DATETIME, XSD_HEXBINARY, and XSD_TIME. Like the other XSD classes, they have a public variable named "Value" that you can get and set. However, the "Value" variable is not of type String.
The information for the classes XSD_BASE64BINARY and XSD_HEXBINARY is passed in NotesStream format.
Public Function addNewFile (title As String, author As String, description As String, _
typeOfBook As BookType, fileName As String, base64file As XSD_BASE64BINARY, _
returnFault As WS_FAULT) As String
Dim book As New BookInfoAndFile
book.title = title
book.author = author
Set book.typeOfBook = typeOfBook
book.description = description
book.fileName = fileName
Set book.base64file = base64file
addNewFile = addNewFileComplex(book, returnFault)
End Function
На вход же подаётся формат notesstream..."SOAP Fault: Client:Type conversion failure for element BASE64FILE Detail: Client:Type conversion failure for element BASE64FILE HRESULT=0x80020005: Type mismatch.
Взломай свой первый сервер и прокачай скилл — Начни игру на HackerLab