Re: Attachments in PHP SOAP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Jul 7, 2005, at 1:12 PM, Dave Robinder wrote:

Please forgive my ignorance, but I have no clue how to go about doing what
you're suggesting.  I'm pretty new to php and have no experience with
customizing it.  I come from a VB background if that helps.

It's not so much customizing it as enhancing the specific class.

Basically, as you've recognized, ext/soap (the built-in SOAP extension documented at http://www.php.net/soap) does not currently have native support for attachments. You thus have 3 options:

1) Use PEAR's SOAP (or another 3rd party implementation that supports the features you need)
2) Stop using attachments
3) Add the ability to use attachments to ext/soap, either by
3a) improving the extension itself (written in C, and thus a good bit of work, but ulimately the way it should get done)
 or
3b) wrapping the SoapClient/SoapServer classes and extending their functionality in PHP to add the features you want (less work, easier to accomplish).


If you go with 3b, then I would recommend looking at how SOAP attachments are handled in the PEAR SOAP class (specifically in SOAP/ Value.php). You can then take this knowledge (or just borrow most of the implementation) and implement attachment handling. This most likely involves intercepting the raw request with a __doRequest() method (assuming you're writing a client), and manually mucking with the message structure.

A example of something that overload __doRequest() can be found here:

http://www.schlossnagle.org/~george/blog/index.php?/archives/235- Salesforce.com-and-PHP.html#extended

Those are pretty much your options.

George

--
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux