Re: Handling attachment Query

Nilay Hazra <[email protected]> Mon, 1 Sep 2003 13:27:44 +0530
Newsgroups gmane.comp.windows.devel.soap.general
Message-ID <[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
----- Original Message -----
From: "Bob Cunnings" <[email protected]>
To: <[email protected]>
Sent: Friday, August 29, 2003 9:32 PM
Subject: Re: [SOAP] Handling attachment Query


> Why not send the filename in the body of the SOAP message along with the
> attachment reference? Take a look at:
>
> http://www.whitemesa.com/dime/echofile.wsdl
>
> which describes a simple file transfer service used a while back for
testing
> DIME interoperability (It actually provides for the transmission of an
> attachment reference and filename in a SOAP header entry as well as in the
> body, but that is only because the service was used for testing purposes).
> The same principle would apply for a doc/lit service.
>
> I briefly considered sending the filename contained in a DIME "option"
> element as part of the DIME packaging of the file attachment, but didn't
> think it was a good idea as I wanted the SOAP message handlers to have
> access to the filename without needing to reach into the DIME package to
get
> it.
>
> I could imagine also sending the filename and any other control data in a
> SOAP header entry, and the attachment reference in the body.
>
> RC
>