CoAttachmentManager CoClass

uuid(c7899023-e487-4268-ae2a-4ec50136dab3)
progid(pocketSOAP.Attachments)

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.
ISOAPTransport  
ISoapAttachmentFormat   Controls the attachment format

 

How to Instantiate

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

 

Sample Code

[VBScript]
' 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 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

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