CoAttachmentManager CoClass


The main object, this manages the request & response attachments for a particular request. Use this object to control the attachments format, access the collection of attachments for the request, and the collection of attachments returned from the server. You can also control memory useage policy, by altering the DiskThreshold property


Supported Interfaces

Name Description
IAttachmentManger  [default] This manages the attachments for a particular request/response exchange.
ISoapAttachmentFormat   Controls the attachment format


How to Instantiate

This is a standard COM object, use CreateObject("PocketSOAP.Attachments") or similar


Sample Code

' 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 "", e.Serialize

' parse the results
e.parse a

' find the response attachment
set theAttachment = a.response.find(e.parameters.item(0).href)
if theAttachment.Located == attInMemory then
	theAttachment.Save "c:\xmlbus.gif"
end if
msgbox "the attachment is saved to " & theAttachment.Body


See Also

The PocketSOAPAttachments Library | 




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