[propget] HRESULT Located([out, retval] AttachmentLocation * loc);
Indicates where the attachment data is currently located, this can either be InMemory (as a byte array), or OnDisk as a disk file.
Values from the AttachmentLocation enumeration, attOnDisk or attInMemory
' create and initialize the SOAP envelope
set e = CreateObject("pocketSOAP.Envelope.2")
e.setMethod "doImage", "urn:AttachmentService"
' create the attachments object, and switch to MIME formatted attachments
set a = CreateObject("pocketSOAP.Attachments")
a.format = formatMime
' create the parameter that has the attachment attached to it
set n = e.parameters.create("gif", empty)
' create the attachment, and create a reference between the attachment and the parameter
n.href = a.Request.Create ("c:\picture.gif", tnfMediaType, "image/gif").Uri
' set the required SOAPAction, then give the transport object, to the attachments object
t.Soapaction = "urn:AttachmentService/doImage"
set a.Transport = t
' now we call send/receive/parse through the attachments object, so that it can
' inject/extract the attachments before sending them through the transport
a.Send "http://interop.xmlbus.com:7002/xmlbus/container/AttachmentApp/AttachmentAppService/AttachmentAppPort/", e.Serialize
' parse the results
e.parse a
' find the response attachment
set theAttachment = a.response.find(e.parameters.item(0).href)
' if the attachment was small enough to stay in memory, force it to be saved to disk
if theAttachment.Located == attInMemory then
theAttachment.Save "c:\xmlbus.gif"
end if
msgbox "the attachment is saved to " & theAttachment.Body
Copyright © Simon Fell, 2000-2004. All rights reserved.