Search code examples
phpzend-frameworksoapattachment

Zend_Soap with attachments (server)


i'm trying to build a SOAP service with Zend_Soap. Everything is working great but the client needs the ability to send attachments to the service (not base64 encoded strings, as this service will be called multiple times a day with various file sizes so processing all that in memory is not possible.

So I'd like to handle a normal SOAP attachment (DIME/MIME) with the SOAP server in Zend Framework however I'm unable to find documentation about it. Can I access it with $_FILES[] or any other way? Is it even possible in Zend_Soap (as there's not that much info available).

SOAP is a must - so thanks for the advice but it has to be SOAP, not REST.


Solution

  • SOAP attachments are not implemented in the standard PHP SoapServer/SoapClient classes and therefore not available in Zend_Soap which is mainly a wrapper for these.

    AFAIK only the PEAR::SOAP class supports attachments but honestly, I gave up and convinced everyone to use base64encoded strings...

    I found this blog post describing at least a client solution with PEAR: http://www.casarini.org/blog/2009/php-soap-messages-with-attachments/