Re: Web service login function to check authenticate user in cakephp

2014-10-14 Thread John Andersen
The error message clearly states that the issue is with the missing Posts 
controller. But you states that the method is in the Users controller. 
Check your code.
Enjoy, John

On Saturday, 11 October 2014 00:33:54 UTC+3, Sam wrote:
>
> I am writing a web service to authenticate whether a user login is valid 
> or not. Below is a simple implementation of the web service placed inside 
> UsersController.php
>
> [snip]
>
>
> It does not work. The error message I received is something like this;
>
> \n\tError: \n\tPostsController could not be found.
>
> \n
> \n\tError: \n\tCreate the class PostsController below in file: 
> app\\Controller\\PostsController.php
>
> [snip]
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


RE: Web service login function to check authenticate user in cakephp

2014-10-11 Thread Saran
Hi Sam,

First thing is that you should used the restful technique that is already in 
CakePHP.

Please go through http://book.cakephp.org/2.0/en/development/rest.html

Now focus on your problem

Yes, you can use the Auth->login but the things is notice how you are posting 
your data, here I am talking about post data array format. Please dump post 
variable that help to solve the issue.

Kind regards
Saran
Sr. Web Developer 

-Original Message-
From: "Radharadhya Dasa" 
Sent: ‎11-‎10-‎2014 11:28 AM
To: "cake-php@googlegroups.com" 
Subject: Re: Web service login function to check authenticate user in cakephp

There is a good chance that the error is not here, but in the code what calls 
this. So please show the code which calls calls the webservice. 
rrd 
2014.10.11. 3:56 ezt írta ("Sam" ):

It is cakephp 2.5

On Saturday, October 11, 2014 9:53:21 AM UTC+8, Matthew Kaufman wrote:
Is this Cake 2.6 or 3?


On Fri, Oct 10, 2014 at 5:33 PM, Sam  wrote:

I am writing a web service to authenticate whether a user login is valid or 
not. Below is a simple implementation of the web service placed inside 
UsersController.php
public function webservice_login() 
{
$this->autoRender = false;
if ($this->request->is('post')) 
{   
if ($this->Auth->login()) 
{
echo json_encode(array('ok_msg' => 'User authentication success'));
}
else
{
echo json_encode(array('fail_msg' => 'User authentication 
failure'));
}
} 
} It does not work. The error message I received is something like this;
\n\tError: \n\tPostsController could not be found.

\n
\n\tError: \n\tCreate the class PostsController below in file: 
app\\Controller\\PostsController.php

\n
\nhttps://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+u...@googlegroups.com.
To post to this group, send email to cake...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.



-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Web service login function to check authenticate user in cakephp

2014-10-10 Thread Radharadhya Dasa
There is a good chance that the error is not here, but in the code what
calls this. So please show the code which calls calls the webservice.

rrd
2014.10.11. 3:56 ezt írta ("Sam" ):

> It is cakephp 2.5
>
> On Saturday, October 11, 2014 9:53:21 AM UTC+8, Matthew Kaufman wrote:
>>
>> Is this Cake 2.6 or 3?
>>
>> On Fri, Oct 10, 2014 at 5:33 PM, Sam  wrote:
>>
>>> I am writing a web service to authenticate whether a user login is valid
>>> or not. Below is a simple implementation of the web service placed inside
>>> UsersController.php
>>>
>>> public function webservice_login() {
>>> $this->autoRender = false;
>>> if ($this->request->is('post'))
>>> {
>>> if ($this->Auth->login())
>>> {
>>> echo json_encode(array('ok_msg' => 'User authentication 
>>> success'));
>>> }
>>> else
>>> {
>>> echo json_encode(array('fail_msg' => 'User authentication 
>>> failure'));
>>> }
>>> } }
>>>
>>> It does not work. The error message I received is something like this;
>>>
>>> \n\tError: \n\tPostsController could not be found.
>>>
>>> \n
>>> \n\tError: \n\tCreate the class PostsController below in file: 
>>> app\\Controller\\PostsController.php
>>>
>>> \n
>>> \n>> \n
>>> \n\tNotice: \n\tIf you want to customize this error message, create 
>>> app\\View\\Errors\\missing_controller.ctp
>>>
>>> What is wrong with the code? How should I rewrite the web service? I am
>>> using Cakephp 2.5. Strange thing is I do not have a controller called Post
>>> in the first place.
>>>
>>> --
>>> Like Us on FaceBook https://www.facebook.com/CakePHP
>>> Find us on Twitter http://twitter.com/CakePHP
>>>
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "CakePHP" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to cake-php+u...@googlegroups.com.
>>> To post to this group, send email to cake...@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/cake-php.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Web service login function to check authenticate user in cakephp

2014-10-10 Thread Sam
It is cakephp 2.5

On Saturday, October 11, 2014 9:53:21 AM UTC+8, Matthew Kaufman wrote:
>
> Is this Cake 2.6 or 3?
>
> On Fri, Oct 10, 2014 at 5:33 PM, Sam > 
> wrote:
>
>> I am writing a web service to authenticate whether a user login is valid 
>> or not. Below is a simple implementation of the web service placed inside 
>> UsersController.php
>>
>> public function webservice_login() {
>> $this->autoRender = false;
>> if ($this->request->is('post')) 
>> {   
>> if ($this->Auth->login()) 
>> {
>> echo json_encode(array('ok_msg' => 'User authentication 
>> success'));
>> }
>> else
>> {
>> echo json_encode(array('fail_msg' => 'User authentication 
>> failure'));
>> }
>> } } 
>>
>> It does not work. The error message I received is something like this;
>>
>> \n\tError: \n\tPostsController could not be found.
>>
>> \n
>> \n\tError: \n\tCreate the class PostsController below in file: 
>> app\\Controller\\PostsController.php
>>
>> \n
>> \n> \n
>> \n\tNotice: \n\tIf you want to customize this error message, create 
>> app\\View\\Errors\\missing_controller.ctp
>>
>> What is wrong with the code? How should I rewrite the web service? I am 
>> using Cakephp 2.5. Strange thing is I do not have a controller called Post 
>> in the first place.
>>
>> -- 
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "CakePHP" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to cake-php+u...@googlegroups.com .
>> To post to this group, send email to cake...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/cake-php.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Web service login function to check authenticate user in cakephp

2014-10-10 Thread Matthew Kaufman
Is this Cake 2.6 or 3?

On Fri, Oct 10, 2014 at 5:33 PM, Sam  wrote:

> I am writing a web service to authenticate whether a user login is valid
> or not. Below is a simple implementation of the web service placed inside
> UsersController.php
>
> public function webservice_login() {
> $this->autoRender = false;
> if ($this->request->is('post'))
> {
> if ($this->Auth->login())
> {
> echo json_encode(array('ok_msg' => 'User authentication 
> success'));
> }
> else
> {
> echo json_encode(array('fail_msg' => 'User authentication 
> failure'));
> }
> } }
>
> It does not work. The error message I received is something like this;
>
> \n\tError: \n\tPostsController could not be found.
>
> \n
> \n\tError: \n\tCreate the class PostsController below in file: 
> app\\Controller\\PostsController.php
>
> \n
> \n \n
> \n\tNotice: \n\tIf you want to customize this error message, create 
> app\\View\\Errors\\missing_controller.ctp
>
> What is wrong with the code? How should I rewrite the web service? I am
> using Cakephp 2.5. Strange thing is I do not have a controller called Post
> in the first place.
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Web service login function to check authenticate user in cakephp

2014-10-10 Thread Sam


I am writing a web service to authenticate whether a user login is valid or 
not. Below is a simple implementation of the web service placed inside 
UsersController.php

public function webservice_login() {
$this->autoRender = false;
if ($this->request->is('post')) 
{   
if ($this->Auth->login()) 
{
echo json_encode(array('ok_msg' => 'User authentication success'));
}
else
{
echo json_encode(array('fail_msg' => 'User authentication 
failure'));
}
} } 

It does not work. The error message I received is something like this;

\n\tError: \n\tPostsController could not be found.

\n
\n\tError: \n\tCreate the class PostsController below in file: 
app\\Controller\\PostsController.php

\n
\nhttps://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


RE: (Web Service) Using XML to Output HTML into my website

2014-05-28 Thread Ricardo Vieitez
Hello,

I guess that you can parse the XML file using PHP and output that as HTML. For 
example:
http://blog.teamtreehouse.com/how-to-parse-xml-with-php5
http://www.php.net/manual/en/book.xml.php

Since you’re using CakePHP, the “right” way is using a DataSource that does 
this conversion. You can either write that yourself (sounds scary, but it’s not 
that bad, especially if you only need to read information), or try to find a 
community-written SOAP datasource that does what you want (or make little 
adjustments to make it work.) For example:”
http://blog.pagebakers.nl/2008/12/18/soapsource-a-soap-client-datasource-for-cakephp/
http://book.cakephp.org/2.0/en/models/datasources.html

Once you convert from SOAP to a CakePHP-DB like sort of thing, generating the 
HTML is simple enough.

An alternative way (non-CakePHP) would be to use XSLT (e.g., 
http://www.w3schools.com/xml/xml_xsl.asp) to convert from HTML to XML. You may 
either accomplish this client-side, or write a simple script (PHP or otherwise) 
that does the parsing. Then you can read the styled document and include it 
where needed.

That should get you started.

PS: Are you sure your domain name isn’t supposed to be .tur.ar? 
https://nic.ar/dominios-tur-ar.xhtml


From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of 
NHGDESIGN
Sent: 27. mai 2014 17:22
To: cake-php@googlegroups.com
Subject: (Web Service) Using XML to Output HTML into my website

Hello. I hope I can explain myself clearly so that I will get help here.

I've been given a web service access to show content to my website (The web 
service is in a another domain). The information is about Hotels (Hotels names, 
Hotel Images, Hotel Category, Hotels Locations, Hotels descriptions).

The file is like the following:
http://www.w3.org/2003/05/soap-envelope"; 
xmlns:bud="http://www.softur.com.ar/wsbridge/budget.wsdl"; 
xmlns:bud1="http://www.softur.com.ar/wsbridge/budget.xsd";>
   
   
  
 

  2014-05-30
  2014-05-31
  
  
FakeID
FakePassWord
  
  USD
  true
  http://www.softur.com.ar/wsbridge/budget.xsd";>
1

  
  

  
  
   


I am running that request using soapUI 3.5.1, which outputs an XML file with 
lots of data about Hotels.


http://www.softur.com.ar/wsbridge/budget.xsd";>Hotel 
Address
HOTEL AGUA DORADA
4 *
http://www.softur.com.ar/wsbridge/budget.xsd";>55
http://www.softur.com.ar/wsbridge/budget.xsd";>Hotel Zone Area
http://www.softur.com.ar/wsbridge/budget.xsd";>Address Description of the 
Hotel Here
http://www.softur.com.ar/wsbridge/budget.xsd";>
-63.93631
11.022754



I want to show that information as an HTML file into my website, but I don't 
know how to go about this.

I guess saving these information appropriately into a database, and then 
spitting that information from the database to my website would be a way.

Any help I can get here using CakePHP so that I would know where to start would 
really help.

Thanks in advance.
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
cake-php+unsubscr...@googlegroups.com<mailto:cake-php+unsubscr...@googlegroups.com>.
To post to this group, send email to 
cake-php@googlegroups.com<mailto:cake-php@googlegroups.com>.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Ricardo Vieitez | Student Assistant - Network Administration
University of Florida Department of Housing and Residence Education
PO Box 112100 | Gainesville, FL 32611-2100
office 352.392.2171 x10355 | fax 352.392.6819 | 
ricar...@housing.ufl.edu<mailto:ricar...@housing.ufl.edu>
StrengthsQuest Top 5: Analytical, Strategic, Learner, Responsibility, Relator - 
Find Out More<http://www.strengthsquest.com/content/141728/index.aspx>
Please consider the environment before printing this email.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: (Web Service) Using XML to Output HTML into my website

2014-05-28 Thread Fernando Negrotto
Hi,

What about moving that data to an array and then use that array to show the
information in html?
Something as follow:

$xml=Xml::build('YOUR XML URL');
$hotelFares = $xml->xpath('HotelFares_PATH_IN_XML');

You can even use Xml::toArray() to convert your object into an array.

Is that what you was looking for?

Regards,

Fernando


2014-05-27 18:21 GMT-03:00 NHGDESIGN :

> Hello. I hope I can explain myself clearly so that I will get help here.
>
> I've been given a web service access to show content to my website (The
> web service is in a another domain). The information is about Hotels
> (Hotels names, Hotel Images, Hotel Category, Hotels Locations, Hotels
> descriptions).
>
> The file is like the following:
>
>> http://www.w3.org/2003/05/soap-envelope";
>> xmlns:bud="http://www.softur.com.ar/wsbridge/budget.wsdl"; xmlns:bud1="
>> http://www.softur.com.ar/wsbridge/budget.xsd";>
>>
>>
>>   
>>  
>> 
>>   2014-05-30
>>   2014-05-31
>>   
>>   
>> FakeID
>> FakePassWord
>>   
>>   USD
>>   true
>>   http://www.softur.com.ar/wsbridge/budget.xsd";>
>> 1
>> 
>>   
>>   
>> 
>>   
>>   
>>
>> 
>
>
> I am running that request using soapUI 3.5.1, which outputs an XML file
> with lots of data about Hotels.
>
> > BackOfficeOperatorCode="00658" xmlns="">
>> http://www.softur.com.ar/wsbridge/budget.xsd";>Hotel
>> Address
>> HOTEL AGUA DORADA
>> 4 *
>> http://www.softur.com.ar/wsbridge/budget.xsd";>55
>> http://www.softur.com.ar/wsbridge/budget.xsd";>Hotel Zone Area
>> http://www.softur.com.ar/wsbridge/budget.xsd";>Address Description of the
>> Hotel Here
>> http://www.softur.com.ar/wsbridge/budget.xsd";>
>> -63.93631
>> 11.022754
>> 
>> 
>
>
> I want to show that information as an HTML file into my website, but I
> don't know how to go about this.
>
> I guess saving these information appropriately into a database, and then
> spitting that information from the database to my website would be a way.
>
> Any help I can get here using CakePHP so that I would know where to start
> would really help.
>
> Thanks in advance.
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Fernando Negrotto

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


(Web Service) Using XML to Output HTML into my website

2014-05-28 Thread NHGDESIGN
Hello. I hope I can explain myself clearly so that I will get help here.

I've been given a web service access to show content to my website (The web 
service is in a another domain). The information is about Hotels (Hotels 
names, Hotel Images, Hotel Category, Hotels Locations, Hotels descriptions).

The file is like the following:

> http://www.w3.org/2003/05/soap-envelope"; 
> xmlns:bud="http://www.softur.com.ar/wsbridge/budget.wsdl"; 
> xmlns:bud1="http://www.softur.com.ar/wsbridge/budget.xsd";>
>
>
>   
>  
> 
>   2014-05-30
>   2014-05-31
>   
>   
> FakeID
> FakePassWord
>   
>   USD
>   true
>xmlns="http://www.softur.com.ar/wsbridge/budget.xsd";>
> 1
> 
>   
>   
> 
>   
>   
>
> 


I am running that request using soapUI 3.5.1, which outputs an XML file 
with lots of data about Hotels.

 BackOfficeOperatorCode="00658" xmlns="">
>  xmlns="http://www.softur.com.ar/wsbridge/budget.xsd";>Hotel 
> Address
> HOTEL AGUA DORADA
> 4 *
>  xmlns="http://www.softur.com.ar/wsbridge/budget.xsd";>55
>  xmlns="http://www.softur.com.ar/wsbridge/budget.xsd";>Hotel Zone 
> Area
>  xmlns="http://www.softur.com.ar/wsbridge/budget.xsd";>Address Description of 
> the Hotel Here
>  xmlns="http://www.softur.com.ar/wsbridge/budget.xsd";>
> -63.93631
> 11.022754
> 
> 


I want to show that information as an HTML file into my website, but I 
don't know how to go about this. 

I guess saving these information appropriately into a database, and then 
spitting that information from the database to my website would be a way.

Any help I can get here using CakePHP so that I would know where to start 
would really help.

Thanks in advance.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


How to remove element from json web service when using _serialize in Cakephp?

2014-03-18 Thread Sam


Cakephp _serialize() automatically appends a  element when it is 
used to generate a json web service. This  element causes problem 
for the front-end to parse. How can this  element be removed from 
Cakephp? I am using Cakephp 2.4.5

http://book.cakephp.org/2.0/en/views/json-and-xml-views.html

I asked this question on Stack Overflow but could not get any answers. I 
wonder if the experts here can give me some advice. Thanks a lot in advance.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: How to update data in several models in a single Web Service?

2014-03-09 Thread kdubya
Your statement "the problem with CakePHP is that it only allows a 
controller to access its own corresponding model's data" is just flat 
wrong. You can access additional models in a controller by simply adding 
the model name to the $uses variable in the controller class.

For example, the following allows you to access both the Recipe and User 
models in the Recipe controller (you can find more in the book 
at http://book.cakephp.org/2.0/en/controllers.html):

class RecipesController extends AppController {
public $uses = array('Recipe', 'User');
.
public function someAction() {
.
   $user = $this->User->find('first', array('conditions'=>array('id', 
$userId)));
.
}
}

You can also achieve what you wish by using model associations. See:
 http://book.cakephp.org/2.0/en/models/associations-linking-models-together.html

In your Table1 model class,  you define a $hasMany association with Table2, 
and in your Table2 model you define a $hasMany association with Table3. You 
can then access the "lower level" associations by doing a find() on Table1. 

You should also look at the Containable behavior. It makes it easy to 
define which models are retrieved when a find() is done. Containable is so 
handy I have put it in my AppModel class so all models have that behavior. 
See:
http://book.cakephp.org/2.0/en/core-libraries/behaviors/containable.html

All of what you need to do this is described in the book and the examples. 
Study them. Try them. If you then have trouble, we'll answer your questions.

Ken

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


How to update data in several models in a single Web Service?

2014-03-08 Thread Sam
There are 3 tables in my database. Table1 has a one-to-many relationship to 
Table2. Table2 has a one-to-many relationship to Table3. I would like to 
write a web service API that allows the user to add rows to all 3 tables at 
the same time. The problem with CakePHP is that it only allows a controller 
to access its own corresponding model's data. How can a controller access 
other models? What is the best practices for CakePHP for a single 
controller to access other models? For my case in particular, which table 
should I use? Will Table1 be a good start since it is the parent to the 
other tables?

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Web Service factories to aid unit testing in CakePHP

2012-11-06 Thread Reuben
Hi

This is probably more of a general programming question for PHP, but 
because it takes CakePHP into account, in particular, I thought I'd try a 
post here.

I've recently upgraded an old project to CakePHP 2.2.3, and I'm now writing 
some unit tests (yay for PHPUnit), but they're after the fact (naughty me).

One of my models is a non tabled model that has a search function that uses 
a SoapClient.  At one point, the model would instantiate the SoapClient in 
the search function, but when it came to writing unit tests for the search 
function, that sort of action made it hard to mock the web service.

So I put a $client property on the model.  I then moved instantiation of 
the SoapClient to the constructor, put was also able to assign a mocked 
SoapClient to the model in the unit test.

When I was reading around on how to mock web services, I found this article 
[
http://pointbeing.net/weblog/2009/04/unit-testing-code-which-consumes-soap-services.html].
 
 It talks a little bit about how the web services should be created in a 
factory, but doesn't go into detail.  So, I'm interested in how, or even 
if, you would do a web service factory in CakePHP, and how that should look 
when using the model in a controller, or anywhere else.

I understand that in any other language, or perhaps without the restriction 
of CakePHP (though that's a restriction in my own mind), this would be a 
great time to use an Inversion of Control container and apply the 
dependency injection in the production code, not just the unit test. 
 However, this is CakePHP, and models are handled automagically via $uses, 
or manually via Controller::loadModel() or ClassRegistry::init().

I guess one way would be to refactor usage of the SoapClient as a 
datasource.  I've used the Soap datasource from the datasources plugin a 
couple of times, but I've always found it wanting for CakePHP 2.X.  Maybe 
that will change for CakePHP 3.

When I started writing this, I was looking for the CakePHP way of web 
service factories, but now I think I've arrived at the answer being 
Datasources. Thoughts and comments would be appreciated.

Regards
Reuben Helms

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Cakephp user session in web service

2012-06-26 Thread Dr. Tarique Sani
With a web service your authentication system should be stateless -
that is not dependent on session

Start at 
http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#creating-stateless-authentication-systems

HTH
Tarique

On Fri, Jun 22, 2012 at 5:18 PM, Kiran Ambati  wrote:
> Hi All,
>
> In cakephp 2.1, I am developing a cakephp application , also web service for
> third party application to access data. Output is json.
>
> First time when user logs in through web service we create some
> authentication token and for every next call client will send the
> authentication token and I have to check authentication token available to
> allow other actions of app.
>
> I wrote a login function. when user tries to logs in , it returns success or
> failure message. This is where I stuck. How to create this authentication
> token? Where does cakephp store user related session? Can I write session
> like
>
>> $this->Session->Write('check.session','random string')
>
> and then read it in second client call using
>
> $this->Session->read('check.session').
>
> Or is there any other better way to achieve this.
>
> --
> Thank you,
> Kiran.
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at
> http://groups.google.com/group/cake-php



-- 
=
PHP for E-Biz: http://sanisoft.com
=

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Cakephp user session in web service

2012-06-22 Thread Kiran Ambati
Hi All,

In cakephp 2.1, I am developing a cakephp application , also web service
for third party application to access data. Output is json.

First time when user logs in through web service we create some
authentication token and for every next call client will send the
authentication token and I have to check authentication token available to
allow other actions of app.

I wrote a login function. when user tries to logs in , it returns success
or failure message. This is where I stuck. How to create this
authentication token? Where does cakephp store user related session? Can I
write session like

> $this->Session->Write('check.session','random string')

and then read it in second client call using

$this->Session->read('check.session').

Or is there any other better way to achieve this.

-- 
*Thank you,*
*Kiran.*

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Array formatting from XML web service using Set::combine

2011-02-27 Thread Greg Skerman
sorry, second array should be:

array(
'Result' => array(
0 => array(
'userID' => 5,
'name' => 'bill'
),
1 => array(
'userID' => 25,
'name' => 'jane'
)
)
);


On Sun, Feb 27, 2011 at 11:34 PM, Greg Skerman  wrote:

> I'm having a bit of trouble with Set::combine when using it to deal with
> xml converted into an array.
>
> I am using the XML utility library, then Set::reverse() to flip it from an
> object into an array for easy traversal
>
> The problem is that if a child element only contains 1 record, it is
> formatted as such:
>
> array(
> 'Result' => array(
> 'userID' => 5,
> 'name' => 'bill'
> )
> );
>
> but if the the same child element contains multiple records, it is
> formatted as such:
>
> array(
> 'Result' => array(
> 1 => array(
> 'userID' => 5,
> 'name' => 'bill'
> ),
> 2 => array(
> 'userID' => 25,
> 'name' => 'jane'
> )
> )
> );
>
>
> how do I reliably reformat this array using Set::combine() to provide me
> with an array whos keys are userID and whos values are name?
>
> I've tried using Path1 as 'Result.{n}.userID' and Path2 as
> 'Result.{n}.name', however this will not work in the first instance as it is
> doesn't contain the {n} path
>
>
>
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Array formatting from XML web service using Set::combine

2011-02-27 Thread Greg Skerman
I'm having a bit of trouble with Set::combine when using it to deal with xml
converted into an array.

I am using the XML utility library, then Set::reverse() to flip it from an
object into an array for easy traversal

The problem is that if a child element only contains 1 record, it is
formatted as such:

array(
'Result' => array(
'userID' => 5,
'name' => 'bill'
)
);

but if the the same child element contains multiple records, it is formatted
as such:

array(
'Result' => array(
1 => array(
'userID' => 5,
'name' => 'bill'
),
2 => array(
'userID' => 25,
'name' => 'jane'
)
)
);


how do I reliably reformat this array using Set::combine() to provide me
with an array whos keys are userID and whos values are name?

I've tried using Path1 as 'Result.{n}.userID' and Path2 as
'Result.{n}.name', however this will not work in the first instance as it is
doesn't contain the {n} path

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


How Use Rest Web Service

2010-03-23 Thread Jets
Hi, i wanna know that how use rest web service in cake. Can u give any
example for this.

Thanks

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Web Service cakePHP

2010-02-17 Thread ivan
You can give me tutorial about REST cakePHP? please help me this
tutorial.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Web Service cakePHP

2010-02-17 Thread ivan
You have the best tutorial about REST cakePHP? please give me this
tutorial or recommendation tutorial about this.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Web Service cakePHP

2010-02-16 Thread ivan
what with REST cakePHP, we can send many data (array)? What easy to
implementation is it?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Web Service cakePHP

2010-02-16 Thread ivan
What you have the best recommendation tutorial about make REST with
cakePHP? please give me simple helper but the best helper. At now i
make final task in my university. Thanks before. God Bless You all.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Web Service cakePHP

2010-02-16 Thread Chad Smith
I agree with cronet,

It's revolutionary for a PHP Framework to have an API built into it
natively.  Look at the others out there Symfony, CodeIgniter, Zend ...
do they have a built-in already configured REST API for the data?  Not
that I know of.

So it doesn't support SOAP.  With The Easy API : http://theeasyapi.com
we found that most people don't like SOAP.  They greatly prefer a REST
interface that's using POST, or GET for most of the heavy lifting.
Take a look at this industry staple in the API world  :
http://www.programmableweb.com/apis ... notice that 70% prefer the
REST architecture opposed to just a mere 19% who prefer SOAP.  That
should really hit home right there.  There is no advantage to using
SOAP in my opinion.

Take care, and what is your application?  The Easy API is always on
the lookout for strong stable API's to add in.
Chad

On Feb 16, 3:46 am, cronet  wrote:
> you could add soap support simply by loading a soap class (e.g.
> nusoap) as vendor...
> It's much simpler using the built in rest functions... but that
> depends on what webservice you want to create or use.
>
> On 15 Feb., 10:43, ivan  wrote:
>
> > What cakePHP support REST only? What cakePHP support SOAP? and What
> > you have more teory about webservice in cakePHP? thanks before.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Web Service cakePHP

2010-02-16 Thread cronet
you could add soap support simply by loading a soap class (e.g.
nusoap) as vendor...
It's much simpler using the built in rest functions... but that
depends on what webservice you want to create or use.

On 15 Feb., 10:43, ivan  wrote:
> What cakePHP support REST only? What cakePHP support SOAP? and What
> you have more teory about webservice in cakePHP? thanks before.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Web Service cakePHP

2010-02-15 Thread ivan
What cakePHP support REST only? What cakePHP support SOAP? and What
you have more teory about webservice in cakePHP? thanks before.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Web Service cakePHP

2010-02-14 Thread Chad Smith
Ivan,

You can check out CakePHP's REST implementation: 
http://book.cakephp.org/view/476/REST

REST is by far the most common way of having an API be built.  It's
not how http://theeasyapi.com was done because we needed more security
than that but it's a way of having it be done.

Take care,
Chad

On Feb 12, 10:34 pm, ivan  wrote:
> I need a complete theory as WebService cakephp cakephp full theory
> itself. Please give me solution. thanks before you help me. God Bless
> You.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Web Service cakePHP

2010-02-13 Thread ivan
I need a complete theory as WebService cakephp cakephp full theory
itself. Please give me solution. thanks before you help me. God Bless
You.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Web Service cakePHP

2010-02-13 Thread ivan
What you have link web (URL), where i can see and know teory about
webservice in cakePHP? In goole many tutorial but not teory for this
topic. I will references this topic to my final task in my university.
I very hope you can help me. I'm confuse so searching this topic. In
my final task i will make application web bible and have webservice
the bible.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Web Service cakePHP

2010-02-12 Thread Chad Smith
Ivan,

I know there are a lot of Web Services out there that are using cake.
Mostly because Cake offers a lot of flexibility with the ability of
creating subdomains and using the bootstrap file to grab the subdomain
and pass the $_GET['url'] with the name of the account being the
subdomain.

I've setup a major service named The Easy API, you can find it at
http://theeasyapi.com what we do is provide an API that interfaces and
standardizes other API's together into one commonly accessible API.
Another one I setup is County Criminal at http://www.countycriminal.com
where it offers an API in the backend and also uses a lot of sub-
domain rewriting but is all done with cake.

Web services have a lot of advantages, the main one being the ability
to update your code without having to send program updates.  It also
allows you to have control over security and new features.  Web
services are really powerful because it doesn't rely on the person who
is using the web service's server.  Most the time when you get new
software the software has to ensure it will work on whatever machine
it's going on.  Not true with Web Services, since the modern web
services operate without dependencies on the remote server.

Take care and hope I answered your question,
Chad

On Feb 10, 11:52 pm, ivan  wrote:
> Please give me teory to webservice cakePHP. How webservice CakePHP
> work? What the advantages of using webservice in cakePHP?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Web Service cakePHP

2010-02-10 Thread ivan
Please give me teory to webservice cakePHP. How webservice CakePHP
work? What the advantages of using webservice in cakePHP?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Web Service

2009-04-24 Thread Dave

Rest is built into CakePHP. http://book.cakephp.org/view/476/REST

We've been investigating Web Services as well, and a Java
implementation performs a lot better than Apache/PHP, although it is a
fair bit more complex to get running. Worth thinking about if it's
going to be a highly loaded service. For a small, infrequently used
one Cake will be fine though, and you'll get it up and running in no
time (I wish Java was as easy!)

On Apr 23, 10:49 am, Rahul Sinhaa  wrote:
> Hello guys ,
>
> We have to start a new project using cake php framework.
> The project is related to WEB Services.
>
> We have to create a WEB SERVICE -server , I want you guys to help me
> deciding on the WEB SERVICE method (SOAP, REST ..) since I am not sure
> that which method will be the best match for CAKE PHP and their
> limitations also.
>
> Thanks in advance
>
> -Rahul
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Web Service

2009-04-23 Thread Rahul Sinhaa

Hello guys ,

We have to start a new project using cake php framework.
The project is related to WEB Services.

We have to create a WEB SERVICE -server , I want you guys to help me
deciding on the WEB SERVICE method (SOAP, REST ..) since I am not sure
that which method will be the best match for CAKE PHP and their
limitations also.

Thanks in advance

-Rahul

--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: REST web service problem

2009-03-10 Thread Brendon Kozlowski

A Google search would be very helpful to you, so long as you also
include the correct version number in your search.  Most likely you've
downloaded Cake v1.2, whereas the Bakery article you've mentioned
points to version 1.1 - there are some subtle yet important
differences in how each of these versions work.  The tutorial will not
work with version 1.2.

http://www.littlehart.net/atthekeyboard/2007/04/11/doing-radar-in-cakephp/
^ That's an example with a BETA version of 1.2.  I *think* the only
difference would be in how the "renderElement()" method is now simply
called "element()".

I didn't verify the contents of this tutorial piece, but I BELIEVE
that this is also version 1.2 code:
http://c7y.phparch.com/c/entry/1/art,cakephp-rest


On Mar 10, 2:59 am, lakers fan  wrote:
> Hello,
>
>       Has anyone tried REST webservice with CakePhp?. I tried the tutorial in 
> bakery, which doesnt work.. I get Object not found error. Am I missing 
> anything in routes?. I m new to cake. I thought I can just create the files 
> as mentioned in tutorial and it will work.. but it didnt. Any help would be 
> great. Or can someone give an alternate link to a working web service?
>
> http://bakery.cakephp.org/articles/view/restful-web-services-with-cak...
>
> Thanks,
>
> Bharani
>
> _
> Hotmail® is up to 70% faster. Now good news travels really 
> fast.http://windowslive.com/online/hotmail?ocid=TXT_TAGLM_WL_HM_70faster_0...
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



REST web service problem

2009-03-09 Thread lakers fan

Hello,

  Has anyone tried REST webservice with CakePhp?. I tried the tutorial in 
bakery, which doesnt work.. I get Object not found error. Am I missing anything 
in routes?. I m new to cake. I thought I can just create the files as mentioned 
in tutorial and it will work.. but it didnt. Any help would be great. Or can 
someone give an alternate link to a working web service?

 

http://bakery.cakephp.org/articles/view/restful-web-services-with-cakephp

 

Thanks,

Bharani

_
Hotmail® is up to 70% faster. Now good news travels really fast. 
http://windowslive.com/online/hotmail?ocid=TXT_TAGLM_WL_HM_70faster_032009
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



REST Web service not working

2009-03-09 Thread lakers fan

Hello,

I just did REST cakephp webservice at the following link

http://bakery.cakephp.org/articles/view/restful-web-services-with-cakephp

But when i tried this

http://localhost/rest/countries/listing 

It didnt work..Error was Object not found!.. So its not able to find the 
controller.

Dont know what i m doing wrong.. any help would be appreciated.

Thanks,
Bharani
_
Hotmail® is up to 70% faster. Now good news travels really fast. 
http://windowslive.com/online/hotmail?ocid=TXT_TAGLM_WL_HM_70faster_032009
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Exposing a Web Service on a Cake Shell

2009-01-05 Thread The_Saint

> Well I don't think that because databases are getting better then we
> should stop writing good code because the database can handle the
> extra load of a bad written application, at least in my case. The log
> file I'm processing with the cake shell is being written constantly,
> and the data that I need from the database could be thousands of
> registers, so doing several queries to the database per second to
> bring  the same thousand of records each time in most cases just to
> see if there's a new one seems like a bad idea to me.
>
> OTOH being able to notify the cake shell when there's new data that it
> can query or send it the new data is a much better solution, like with
> a web service, but I don't know if I can use them with a cake shell.
>

What you are talking about is an event loader. Depending what the log
is logging you can do two things:
- Do a cron job on a specific time
- Find out when the log is updated and fire the event there and then.

Updating on files changes is a bit difficult. I have a perl-script
(yes, need to change it to php, one day) that fills a temp-file. The
data there is only valid for 2 days. (email validation)
Every time the script runs it just looks in that temp-file and cleans
it up. Otherwise it just sits there with obsolete data. The script
does different things so it gets called for different reasons.

Either put some handler in the your index or any other file that gets
frequently called to fire your function. It's not a decent method, and
if it's a big job don't do it. But it's a way of doing it. Kinda
random cron-job.

If you're running windows use the windows task scheduler with php.exe

Daniel
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Exposing a Web Service on a Cake Shell

2009-01-05 Thread Juan Luis Baptiste

On Sun, Jan 4, 2009 at 12:35 PM, Adam Royle  wrote:
>
> Todays databases are designed to handle a crapload of queries, so
> don't be afraid to take advantage of this. Just make sure you've got
> indexes on the right columns and your queries are using those indexes.
> You could possible create another table which is optimised to hold any
> database changes made along with a timestamp.
>

Well I don't think that because databases are getting better then we
should stop writing good code because the database can handle the
extra load of a bad written application, at least in my case. The log
file I'm processing with the cake shell is being written constantly,
and the data that I need from the database could be thousands of
registers, so doing several queries to the database per second to
bring  the same thousand of records each time in most cases just to
see if there's a new one seems like a bad idea to me.

OTOH being able to notify the cake shell when there's new data that it
can query or send it the new data is a much better solution, like with
a web service, but I don't know if I can use them with a cake shell.

Cheers,
--
Juan Luis.

--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Exposing a Web Service on a Cake Shell

2009-01-04 Thread Adam Royle

Todays databases are designed to handle a crapload of queries, so
don't be afraid to take advantage of this. Just make sure you've got
indexes on the right columns and your queries are using those indexes.
You could possible create another table which is optimised to hold any
database changes made along with a timestamp.

Cheers,
Adam

On Jan 4, 6:44 pm, "Juan Luis Baptiste" 
wrote:
> Hi,
>
> It's possible to expose a web service that receives some data on a
> Cake shell? I have a cake shell that monitors a log and reads from it
> some data and compares it with another data in a database to do some
> stuff. The problem is that if the data in the database get's updated,
> the only way to get it into the cake shell without querying the
> database each time the shell reads something from the log file is by
> restarting the cake shell. I was thinking that I could expose a web
> service method on the cake shell that receives the new data it needs
> to compare, so it could be invoked from the cake web application that
> saves the data into the database. Is this possible ? or anyone else
> has another solution that avoids querying the database on each read
> from the log ?
>
> Cheers,
> Juan Luis
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Exposing a Web Service on a Cake Shell

2009-01-04 Thread Juan Luis Baptiste

Hi,

It's possible to expose a web service that receives some data on a
Cake shell? I have a cake shell that monitors a log and reads from it
some data and compares it with another data in a database to do some
stuff. The problem is that if the data in the database get's updated,
the only way to get it into the cake shell without querying the
database each time the shell reads something from the log file is by
restarting the cake shell. I was thinking that I could expose a web
service method on the cake shell that receives the new data it needs
to compare, so it could be invoked from the cake web application that
saves the data into the database. Is this possible ? or anyone else
has another solution that avoids querying the database on each read
from the log ?

Cheers,
Juan Luis

--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Where to integrate web service API

2008-12-23 Thread tekomp

I'm working on an app that needs to integrate with the salesforce.com
api, but not sure where that code should be... it will be managing
data, so a model would be appropriate, but perhaps a datasource would
be better because it's for data from an external source?  Or would it
best be integrated as a Component?

Is it a matter of preference?  I'm trying to figure out the pros and
cons of the different ways of implementing external API's like
Salesforce, but can't find a whole lot of information in that regard
so would love to get some suggestions.

Thanks.
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---