21301 Posts in 5736 Topics by 2603 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1414 Views |
-
Cant get RestfulService to work with ->Request()

12 May 2010 at 9:34am
Hi all, Since RestfulService::Connect has been depreciated, can someone point out what I am doing wrong here?
Here is my code, I get no response. But when I used ->Connect() instead of ->Request(), it worked.
Can someone point out what I am missing?
The $url = a twitter user feed.function doCall($url = null, $requireAuth = false,$params = null){
try{
$twitter = new RestfulService( $url );
if($params)
$twitter->setQueryString($params);
$conn = $twitter->request();
$xml = @simplexml_load_string($conn);
if($xml == false){
return false;
}else{ return $xml;}
}
catch(Exception $e){
return false;
}
} -
Re: Cant get RestfulService to work with ->Request()

12 May 2010 at 9:44am
This line is not returning anything?
$xml = @simplexml_load_string($conn);
Any Idea? It seems that $conn returns from -->Request as an obj and not a string. -
Re: Cant get RestfulService to work with ->Request()

12 May 2010 at 10:11am
adding $conn = $conn->simpleXML(); seems to fix it.
-
Re: Cant get RestfulService to work with ->Request()

15 May 2010 at 12:22am
if there is'nt a RestFull service, How is possible to communicate with SS from remote service?
-
Re: Cant get RestfulService to work with ->Request()

15 May 2010 at 10:31am
Hi otherjohn,
Running into the same problem, trying out 2.4 stable and modifying the old Twitter module.
adding "$conn = $conn->simpleXML();" didn't do it for me, the "$xml = @simplexml_load_string($conn);" still returns nothing.
Could you repost your final code? Hoping I can figure something out for this.
Thanks!
-
Re: Cant get RestfulService to work with ->Request()

18 May 2010 at 9:53pm
Hi
SS 2.4.0 Since RestfulService::Connect has been depreciated, so we replace to ->request('')->getBody();
eg.,
$newsdet = new RestfulService($url,"3600");
$conn = $newsdet->request('')->getBody();
$msgs = $newsdet->getValues($conn);Hope its works
Regards,
Ram
http://www.agriya.com,http://www.rayzz.net, http://www.anova.tv, http://www.isocial.in, http://www.markit.me -
Re: Cant get RestfulService to work with ->Request()

12 August 2010 at 11:58am
Hi,
but if I need obtain values and attributes, have I to use getValues and getAttributes? Because by the moment I have to use simplexml_load_string and after create a DataObjectSet and fill it with a values and attributes array.
Regards.
| 1414 Views | ||
|
Page:
1
|
Go to Top |




