attachment.php 878 B

1234567891011121314151617181920212223242526
  1. <?php
  2. require_once("SOAP/Client.php");
  3. require_once("SOAP/test/test.utility.php");
  4. require_once("SOAP/Value.php");
  5. $filename = 'attachment.php';
  6. $v = new SOAP_Attachment('test','text/plain',$filename);
  7. $methodValue = new SOAP_Value('testattach', 'Struct', array($v));
  8. $client = new SOAP_Client('mailto:user@domain.com');
  9. # calling with mime
  10. $resp = $client->call('echoMimeAttachment',array($v),
  11. array('attachments'=>'Mime',
  12. 'namespace'=>'http://soapinterop.org/',
  13. 'from'=>'user@domain.com',
  14. 'host'=>'smtp.domain.com'));
  15. print $client->wire."\n\n\n";
  16. print_r($resp);
  17. # calling with DIME
  18. $resp = $client->call('echoMimeAttachment',array($v));
  19. # DIME has null spaces, change them so we can see the wire
  20. $wire = str_replace("\0",'*',$client->wire);
  21. print $wire."\n\n\n";
  22. print_r($resp);
  23. ?>