<slide title="Attachments API">
<list>
<bullet>SOAP_Attachment</bullet>
<blurb>Encapsulates data to serialize to SOAP.</blurb>
</list>
<list>
    <bullet>Constructor</bullet>
</list>
<list marginleft="2em">
<bullet>Arg 1 Required: String: Name</bullet>
<bullet>Arg 2 Required: String: Type (default application/octet-stream)</bullet>
<bullet>Arg 3 Required: String: Filename</bullet>
<bullet>Arg 4 Optional: String: File (actual contents of file or data to be sent)</bullet>
</list>
<blurb>If you only specify the filename, the SOAP_Attachment class will
attempt to read the file into memory and send the data.  DIME is the default
attachment method if the 'attachments' option is not defined.</blurb>
<example type="php" title="Example Usage" fontsize='1.4em'>
<![CDATA[<?php
$filename = 'attachment.zip';
$v =  new SOAP_Attachment('test','text/plain',$filename);
$methodValue = new SOAP_Value('testattach', 'Struct', array($v));
?>
]]>
</example>
<example type="php" title="Full Example" fontsize='1.4em'>
<![CDATA[<?php
$filename = 'attachment.php';
$v =  new SOAP_Attachment('test','text/plain',$filename);
$methodValue = new SOAP_Value('testattach', 'Struct', array($v));

$client = new SOAP_Client('mailto:user@domain.com');
# calling with mime
$resp = $client->call('echoMimeAttachment',array($v),
                array('attachments'=>'Mime',
                    'namespace'=>'http://soapinterop.org/',
                    'from'=>'user@domain.com',
                    'host'=>'smtp.domain.com'));
?>
]]>
</example>
<example type="text" fontsize='1.4em' title="SOAP Message with Mime Attachments:">
<![CDATA[POST /soap_interop/server_round2.php HTTP/1.0
User-Agent: PEAR-SOAP 0.6.1
Host: www.caraveo.com
Content-Type: multipart/related; type=text/xml;
    boundary="=_a9e37cebd5684ebda52242db0a004f81"
Content-Length: 2042
SOAPAction: ""

--=_a9e37cebd5684ebda52242db0a004f81
Content-Type: text/xml; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<?xml version=3D"1.0" encoding=3D"UTF-8"?>

<SOAP-ENV:Envelope
 xmlns:SOAP-ENV=3D"http://schemas.xmlsoap.org/soap/envelope/"
 xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema"
 xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance"
 xmlns:SOAP-ENC=3D"http://schemas.xmlsoap.org/soap/encoding/"
 xmlns:ns4=3D"http://soapinterop.org/"
 SOAP-ENV:encodingStyle=3D"http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>

<ns4:echoMimeAttachment>
<test href=3D"cid:71df492641cddfe43fe3f7b057301fd5"/>
</ns4:echoMimeAttachment>

</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

--=_a9e37cebd5684ebda52242db0a004f81
Content-Disposition: attachment.php
Content-Type: text/plain
Content-Transfer-Encoding: base64
Content-ID: <71df492641cddfe43fe3f7b057301fd5>

PD9waHANCnJlcXVpcmVfb25jZS
...
cmludCAkd2lyZS4iXG5cblxuIjsN
--=_a9e37cebd5684ebda52242db0a004f81--
]]>
</example>
</slide>    
