ISoapAttachment::Initialize Method

HRESULT Initialize([in] VARIANT body, [in] TypeNameFormat typeNameFormat, [in] BSTR TypeName);

Initializes the attachment to a known state & values

 

Parameters

body
VARIANT, [in]: The attachment body, this can either by a fileName for a disk based attachment, or an array of bytes for an in memory attachment.
typeNameFormat
TypeNameFormat, [in]: The format that the typeName parameter is specified in, this is typically tnfMediaType (for MIME media types) or tnfAbsoluteURI for URI based type identifiers in DIME (DIME also supports MIME media types)
TypeName
BSTR, [in]: The actual typeName of the attachment, the format of which is dependent upon the typeNameFormat parameters, e.g. for a media type it could be "text/plain" or "image/gif". For an absoluteURI typeName, it should be the full absolute URI e.g. "http://schemas.xmlsoap.org/soap/envelope/"

 

Return Values

 

Sample Code

dim a
set a = CreateObject("Attachments.Attachment")
a.Initialize "c:\myPicture.gif", tnfMediaType, "image/gif"

' note that the Create method on the attachments collection, calls initialize, so you can also do
dim mgr, a
set mgr = CreateObject("PocketSOAP.Attachments")
set a = mgr.Request.Create ( "c:\myPicture.gif", tnfMediaType, "image/gif" )

 

See Also

The ISoapAttachment Interface | 

 

 

Copyright

Copyright © Simon Fell, 2000-2004. All rights reserved.