Re: Handling attachment Query
Nilay Hazra <[email protected]> Mon, 1 Sep 2003 03:57:50 -0400
| Newsgroups | gmane.comp.windows.devel.soap.general |
|---|---|
| Message-ID | <LISTSERV%[email protected]> |
Thanks Bob. Per your suggestion I tried to send an instance of a class
(which contains File Name and File Data as members) to the server. But I'm
getting an error. The steps and sample VB codes are in the following for
your reference.
1. First I've created an ActiveX DLL (FileInfo.dll) with the following code
Private mFileName As String
Private mFileData As MSSOAPLib30.IAttachment
Public Property Get FileName() As String
FileName = mFileName
End Property
Public Property Let FileName(ByVal Value As String)
mFileName = Value
End Property
Public Property Get FileData() As MSSOAPLib30.IAttachment
Set FileData = mFileData
End Property
Public Property Let FileData(ByVal Value As MSSOAPLib30.IAttachment)
Set mFileData = Value
End Property
2. Next I've created another ActiveX DLL (UploadFiles.dll) (which will be
used as the COM object in WSDL Generator tool provided with MS-SOAP toolkit
3.0) with the following codes:
Option Explicit
Public Function ProcessAttachment( _
ByVal AttachIn As FileInfo.FileInfoClass) _
As Boolean
Err.Clear
On Error GoTo ErrorHandler
Dim fso As New FileSystemObject
Dim ReceivedAttach As MSSOAPLib30.IReceivedAttachment
Dim FileName As String
FileName = fso.BuildPath(App.Path, AttachIn.FileName)
' save the AttachIn to a file
Set ReceivedAttach = AttachIn.FileData
ReceivedAttach.SaveToFile FileName, True
ProcessAttachment = True
Exit Function
ErrorHandler:
ProcessAttachment = False
End Function
I've also made sure to check the "FileInfo" box under Project => References.
The DLLs are getting created successfully. But while using WSDL generator
tool for generating WSDL/WSML files, I'm getting the following error
message:
WSDL Generator: Writing the WSML type information for IAttachment failed.
Possibly incorrect registration information. HRESULT=0x80040154: Class not
registered.
I've MS SOAP toolkit installed in my machine and previously I've run all the
"Handing Attachment" samples (provided with the SOAP toolkit) successfully.
Please help me what might be the problem of registration here.
Regards,
nhazra