Friday, June 26, 2009

Re: Connecting to web services

Hello,

What I have done is as simple as:


            $soap = new SoapClient('http://api.example.com/wsdl',
                array(
                    'soap_version' => SOAP_1_1,
                    'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | 5,
                    'exceptions' => false,
                    'cache_wsdl' => WSDL_CACHE_BOTH,
                    'user_agent' => 'Example agent',
                    'features' => SOAP_SINGLE_ELEMENT_ARRAYS
                )
            );
            $param->data = 'me@test.com';
            $response = $soap->suscriberAdd($param);

SoapClient is an standard PHP function.

Regards.



2009/6/25 Turgs <timb.php@gmail.com>

Hello

Within a few different controllers, I need to connect to a web service
using a URL similar to:
http://api.example.com/?command=Subscriber.Add&data=me@test.com

What's the appropriate "cake way" to do this in a way it can be called
from different controllers?
I don't think it should be in it's own model, but I don't know know
else.

Kind regards
Turgs



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: