Showing posts with label Web Services. Show all posts
Showing posts with label Web Services. Show all posts

Friday 17 April 2015

Web Services interview questions and answers for fresher

Web Services interview questions and answers for fresher


Question: What is web services?
It is method of communication between two devices Over the network. With use of web service we can send the request to another device and get the response.
For Example:
We want to know the current weather of "New York, USA".
For this we contact a web service which store the weather information.v Now, We just call
http://domain.com/know-weather-information/city/New York, USA [It is dummy, just for example]
(Here i have pass city name with country (It is request), they will return the city weather information(It is response))



Question: What are famous web service protocols?
In development world, we listen someone using SOAP another one using JSON and third one is using XML-RPC.
Many times, it confuse us that What is these and whey they are using different.
These all are webservice because they are using for exchanging the information.
These are web service but they using different protocol as per their requirement.

Following are some famous protocol used by developers.

  • XML-RPC - XML Remote Procedure Call
  • REST - Representational State Transfer
  • SOAP - outgrowth of XML-RPC, originally an acronym for Simple Object Access Protocol
  • JSON-RPC
  • JSON-WSP
  • UDDI -Universal Description, Discovery, and Integration
  • WPS - Web Processing Service
  • XINS Standard Calling Convention - HTTP parameters in (GET/POST/HEAD), POX out.




Question: What is XML-RPC?
XML-RPC is one of the protocols that use XML for messages between two server.v It is used to "Remote Procedure Calls" using XML.


Question: What is JSON-RPC?
JSON-RPC is one of the protocols that use JSON for messages between two server.
It is used to "Remote Procedure Calls" using JSON.
Format of JSON
{ "version": "1.1", "result": "done", "error": null, "id": "194521489" }



Question: What is JSON-WSP?
It is another term of Web Services only difference is that It uses JSON instead of XML for exchanging the information between two server.
JSON-WSP is simpler as compare to Web Service.



Question: What is SOAP?
SOAP is the protocol used in order to do transfers the data among computers.


Question: What is WSDL?
WDSL is that which describes the interface used in a specific service.



Question: What is Web API? A Web API is a Web services where emphasis has been moving to simpler representational state transfer (REST).
RESTful APIs do not require XML-based Web service protocols (SOAP and WSDL) to support their interfaces.
RESTful mostly use JSON, because it is fast and human readable.


Question: What is REST?
Representational State Transfer (REST) is a software architecture(protocol) style consisting of guidelines and practices for creating scalable web services.
It is simpler as compare to SOAP, WSDL based web services.
It is mostly used by Web pages using HTTP Request.


Question: What are differnet channels used for communication using web services?
HTTP/GET, HTTP/POST and SOAP


Question: What kind of security is needed for web services?
Web services should give response only to autorization calling server.
With each request, sender must send the authorization code and that must be validate by service provider.
We can use SSL for add extra security.



Question: Define Entrust Privacy Service?
It deals with security and confidentiality. This service encrypts data to ensure that only concerned parties can access the data.


Question: What is PKI?
It means Public-Key Infrastructure.


Question: What tools are used to test a SOAP and RESTFul services?
"SoapUI" for SOAP Web service and "Firefox poster plugin" for RESTFul services.


Question: What are distributed technologies?
The increasing ratio of distributed applications has raised demand for distributed technologies.



Question: What is the Web service protocol stack?
The Web service protocol stack is an evolving set of protocols used to define, discover, and implement Web services.


Sunday 12 April 2015

Share count and Share URL of Facebook, Twitter, LinkedIn and Pinterest

Share count and Share URL of Facebook, Twitter, LinkedIn and Pininterest.

Share Count: There are different free api to get the share count of Facebook, Twitter, Linkedin and Pininterest. These number number of counts by all users.

Facebook Share (33)
http://graph.facebook.com/?id=http://www.web-technology-experts-notes.in

Response:
{
   "id": "http://www.web-technology-experts-notes.in",
   "shares": 33
}


Twitter Share (7)
https://share.yandex.ru/gpp.xml?url=http://www.web-technology-experts-notes.in

Response:
"20"


Linkedin Share (6)
 https://www.linkedin.com/countserv/count/share?format=json&url=http://www.web-technology-experts-notes.in
Response:
 {"count":6,"fCnt":"6","fCntPlusOne":"7","url":"http:\/\/www.web-technology-experts-notes.in"}


Pinterest Share (0)
 http://api.pinterest.com/v1/urls/count.json?callback=x&url=http://www.web-technology-experts-notes.in
Resonse:
 x({"url":"http://www.web-technology-experts-notes.in","count":0})





Share URL:Each Social Services (Facebook, Twitter, Linkedin and Pininterest), have its own sharing URL and its work on all global browsers.

Facebook Share (33)
http://www.facebook.com/sharer.php?u=http://www.web-technology-experts-notes.in


Twitter Share (7)
http://www.twitter.com/share?url=http://www.web-technology-experts-notes.in


Pinterest Share (0)
http://pinterest.com/pin/create/button/?media=http://www.web-technology-experts-notes.in


Linkedin Share (6)
http://www.linkedin.com/cws/share?url=http://www.web-technology-experts-notes.in




Share on Twitter with Custom Text
https://twitter.com/intent/tweet?text=this%20is%20custom%20text&url=web-technology-experts-notes.in


Share on Twitter with Custom Text and Via
https://twitter.com/intent/tweet?text=this%20is%20text&via=this_is_via&url=http://www.domain.com


Monday 2 March 2015

Get Youtube video-details and comments using PHP

Get Youtube video-details and comments using PHP

How to get youtube video detail in Zend (Response in JSON)
$uTubeVideoCode ='ryJReIcMGOs';        
        $jsonData='';
        try{            
            $client = new Zend_Http_Client("http://gdata.youtube.com/feeds/api/videos/{$uTubeVideoCode}?v=2&alt=json");
            $response = $client->request('GET');
            $jsonData = $response->getBody();
        
        }  catch (Exception $e){
            echo "Error:".$e->getMessage();
            
        }    
        echo $jsonData;die;

Output:
{"version":"1.0","encoding":"UTF-8","entry":{"xmlns":"http://www.w3.org/2005/Atom","xmlns$gd":"http://schemas.google.com/g/2005","xmlns$yt":"http://gdata.youtube.com/schemas/2007","xmlns$media":"http://search.yahoo.com/mrss/","gd$etag":"W/\"CkACQn47eCp7I2A9XRRWEkU.\"","id":{"$t":"tag:youtube.com,2008:video:ryJReIcMGOs"},"published":{"$t":"2015-02-22T05:17:46.000Z"},"updated":{"$t":"2015-03-02T07:19:23.000Z"},"category":[{"scheme":"http://schemas.google.com/g/2005#kind","term":"http://gdata.youtube.com/schemas/2007#video"},{"scheme":"http://gdata.youtube.com/schemas/2007/categories.cat","term":"People","label":"People & Blogs"}],"title":{"$t":"ICC Cricket World Cup 2015 India Vs South Africa Game 13 Highlights - IND VS SA 22/02/15 2015"},"content":{"type":"application/x-shockwave-flash","src":"http://www.youtube.com/v/ryJReIcMGOs?version=3&f=videos&app=youtube_gdata"},"link":[{"rel":"alternate","type":"text/html","href":"http://www.youtube.com/watch?v=ryJReIcMGOs&feature=youtube_gdata"},{"rel":"http://gdata.youtube.com/schemas/2007#video.related","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs/related?v=2"},{"rel":"http://gdata.youtube.com/schemas/2007#mobile","type":"text/html","href":"http://m.youtube.com/details?v=ryJReIcMGOs"},{"rel":"http://gdata.youtube.com/schemas/2007#uploader","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/users/ZBJOTQ3A-HYLRmpYm4hDeA?v=2"},{"rel":"self","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs?v=2"}],"author":[{"name":{"$t":"SGZ Cricket"},"uri":{"$t":"http://gdata.youtube.com/feeds/api/users/SGZCricket"},"yt$userId":{"$t":"ZBJOTQ3A-HYLRmpYm4hDeA"}}],"yt$accessControl":[{"action":"comment","permission":"allowed"},{"action":"commentVote","permission":"allowed"},{"action":"videoRespond","permission":"moderated"},{"action":"rate","permission":"allowed"},{"action":"embed","permission":"allowed"},{"action":"list","permission":"allowed"},{"action":"autoPlay","permission":"allowed"},{"action":"syndicate","permission":"allowed"}],"gd$comments":{"gd$feedLink":{"rel":"http://gdata.youtube.com/schemas/2007#comments","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs/comments?v=2","countHint":32}},"yt$hd":{},"media$group":{"media$category":[{"$t":"People","label":"People & Blogs","scheme":"http://gdata.youtube.com/schemas/2007/categories.cat"}],"media$content":[{"url":"http://www.youtube.com/v/ryJReIcMGOs?version=3&f=videos&app=youtube_gdata","type":"application/x-shockwave-flash","medium":"video","isDefault":"true","expression":"full","duration":1544,"yt$format":5},{"url":"rtsp://r4---sn-a5m7zu7s.c.youtube.com/CiILENy73wIaGQnrGAyHeFEirxMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp","type":"video/3gpp","medium":"video","expression":"full","duration":1544,"yt$format":1},{"url":"rtsp://r4---sn-a5m7zu7s.c.youtube.com/CiILENy73wIaGQnrGAyHeFEirxMYESARFEgGUgZ2aWRlb3MM/0/0/0/video.3gp","type":"video/3gpp","medium":"video","expression":"full","duration":1544,"yt$format":6}],"media$credit":[{"$t":"sgzcricket","role":"uploader","scheme":"urn:youtube","yt$display":"SGZ Cricket","yt$type":"partner"}],"media$description":{"$t":"ICC Cricket World Cup 2015 India Vs South Africa Game 13 Highlights - IND VS SA 22/02/15 2015\n\nICC Cricket World Cup 2015 India Vs Pakistan Game 4 Highlights - IND VS PAK 15/2/15\n\nICC Cricket World Cup 2015 India Vs South Africa\nICC Cricket World Cup 2015 India Vs South Africa 2/22/15\nICC Cricket World Cup 2015 India Vs South Africa 22 February 2015\n\nSubscribe For More Videos : https://www.youtube.com/user/SGZCricket\nGoogle + : https://plus.google.com/u/0/b/1093080...\n\nExtra Tag : ICC Cricket World Cup 2015 India Vs South Africa 2/22/15 ICC Cricket World Cup 2015 India Vs South Africa 2/22/15 2015 ICC Cricket World Cup 2015 India Vs South Africa 2/22/15 Full Match ICC Cricket World Cup 2015 India Vs South Africa 2/22/15 Highlights ICC Cricket World Cup 2015 India Vs South Africa 02/22/15 Full Results","type":"plain"},"media$keywords":{},"media$license":{"$t":"youtube","type":"text/html","href":"http://www.youtube.com/t/terms"},"media$player":{"url":"http://www.youtube.com/watch?v=ryJReIcMGOs&feature=youtube_gdata_player"},"media$thumbnail":[{"url":"http://i.ytimg.com/vi/ryJReIcMGOs/default.jpg","height":90,"width":120,"time":"00:12:52","yt$name":"default"},{"url":"http://i.ytimg.com/vi/ryJReIcMGOs/mqdefault.jpg","height":180,"width":320,"yt$name":"mqdefault"},{"url":"http://i.ytimg.com/vi/ryJReIcMGOs/hqdefault.jpg","height":360,"width":480,"yt$name":"hqdefault"},{"url":"http://i.ytimg.com/vi/ryJReIcMGOs/sddefault.jpg","height":480,"width":640,"yt$name":"sddefault"},{"url":"http://i.ytimg.com/vi/ryJReIcMGOs/1.jpg","height":90,"width":120,"time":"00:06:26","yt$name":"start"},{"url":"http://i.ytimg.com/vi/ryJReIcMGOs/2.jpg","height":90,"width":120,"time":"00:12:52","yt$name":"middle"},{"url":"http://i.ytimg.com/vi/ryJReIcMGOs/3.jpg","height":90,"width":120,"time":"00:19:18","yt$name":"end"}],"media$title":{"$t":"ICC Cricket World Cup 2015 India Vs South Africa Game 13 Highlights - IND VS SA 22/02/15 2015","type":"plain"},"yt$aspectRatio":{"$t":"widescreen"},"yt$duration":{"seconds":"1544"},"yt$uploaded":{"$t":"2015-02-22T05:17:46.000Z"},"yt$uploaderId":{"$t":"UCZBJOTQ3A-HYLRmpYm4hDeA"},"yt$videoid":{"$t":"ryJReIcMGOs"}},"gd$rating":{"average":1.6350245,"max":5,"min":1,"numRaters":1222,"rel":"http://schemas.google.com/g/2005#overall"},"yt$statistics":{"favoriteCount":"0","viewCount":"397572"},"yt$rating":{"numDislikes":"1028","numLikes":"194"}}}


How to get youtube video comments in Zend(Response in JSON)
        $uTubeVideoCode ='ryJReIcMGOs';        
        $jsonData='';
        try{            
            $client = new Zend_Http_Client("http://gdata.youtube.com/feeds/api/videos/{$uTubeVideoCode}/comments?v=2&alt=json");
            $response = $client->request('GET');
            $jsonData = $response->getBody();
        
        }  catch (Exception $e){
            echo "Error:".$e->getMessage();
            
        } 
echo $jsonData;  

Output:

{"version":"1.0","encoding":"UTF-8","feed":{"xmlns":"http://www.w3.org/2005/Atom","xmlns$gd":"http://schemas.google.com/g/2005","xmlns$openSearch":"http://a9.com/-/spec/opensearch/1.1/","xmlns$yt":"http://gdata.youtube.com/schemas/2007","gd$etag":"W/\"CUYAQ3kzfCp7I2A9XRRWEkU.\"","id":{"$t":"tag:youtube.com,2008:video:ryJReIcMGOs:comments"},"updated":{"$t":"2015-03-02T07:59:02.784Z"},"category":[{"scheme":"http://schemas.google.com/g/2005#kind","term":"http://gdata.youtube.com/schemas/2007#comment"}],"logo":{"$t":"http://www.gstatic.com/youtube/img/logo.png"},"link":[{"rel":"http://schemas.google.com/g/2005#feed","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs/comments?v=2"},{"rel":"http://schemas.google.com/g/2005#batch","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs/comments/batch?v=2"},{"rel":"self","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs/comments?alt=json&max-results=25&v=2"},{"rel":"service","type":"application/atomsvc+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs/comments?alt=atom-service&v=2"}],"author":[{"name":{"$t":"YouTube"},"uri":{"$t":"http://www.youtube.com/"}}],"generator":{"$t":"YouTube data API","version":"2.1","uri":"http://gdata.youtube.com"},"openSearch$totalResults":{"$t":21},"openSearch$itemsPerPage":{"$t":25},"entry":[{"gd$etag":"W/\"AkQDRX47eCp7I2A9XRRXFk0.\"","id":{"$t":"tag:youtube.com,2008:video:ryJReIcMGOs:comment:z13yynd4ssvaubg4n04cf3sytyaijddqwkc0k"},"published":{"$t":"2015-02-22T12:32:54.000Z"},"updated":{"$t":"2015-02-22T12:32:54.000Z"},"category":[{"scheme":"http://schemas.google.com/g/2005#kind","term":"http://gdata.youtube.com/schemas/2007#comment"}],"title":{"$t":"woooooooooooooooow\ufeff"},"content":{"$t":"woooooooooooooooow\ufeff"},"link":[{"rel":"related","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs?v=2"},{"rel":"alternate","type":"text/html","href":"http://www.youtube.com/watch?v=ryJReIcMGOs"},{"rel":"self","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs/comments/z13yynd4ssvaubg4n04cf3sytyaijddqwkc0k?v=2"}],"author":[{"name":{"$t":"Rujul Deshpande"},"uri":{"$t":"http://gdata.youtube.com/feeds/api/users/lIx3u1pJAyoxSMT2YAoEjg"},"yt$userId":{"$t":"lIx3u1pJAyoxSMT2YAoEjg"}}],"yt$channelId":{"$t":"UClIx3u1pJAyoxSMT2YAoEjg"},"yt$googlePlusUserId":{"$t":"102896019321279244010"},"yt$replyCount":{"$t":1},"yt$videoid":{"$t":"ryJReIcMGOs"}},{"gd$etag":"W/\"C04NRH47eCp7I2A9XRRXFko.\"","id":{"$t":"tag:youtube.com,2008:video:ryJReIcMGOs:comment:z12oh5xbdqmmtdgii04ce33x5xz1xz3yrag"},"published":{"$t":"2015-02-23T06:13:15.000Z"},"updated":{"$t":"2015-02-23T06:13:15.000Z"},"category":[{"scheme":"http://schemas.google.com/g/2005#kind","term":"http://gdata.youtube.com/schemas/2007#comment"}],"title":{"$t":"can someone tell me ..."},"content":{"$t":"can someone tell me which game is this???\ufeff"},"link":[{"rel":"related","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs?v=2"},{"rel":"alternate","type":"text/html","href":"http://www.youtube.com/watch?v=ryJReIcMGOs"},{"rel":"self","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs/comments/z12oh5xbdqmmtdgii04ce33x5xz1xz3yrag?v=2"}],"author":[{"name":{"$t":"sajan sebastian"},"uri":{"$t":"http://gdata.youtube.com/feeds/api/users/xzNmG-CxBF8AkMEtmtaCOw"},"yt$userId":{"$t":"xzNmG-CxBF8AkMEtmtaCOw"}}],"yt$channelId":{"$t":"UCxzNmG-CxBF8AkMEtmtaCOw"},"yt$googlePlusUserId":{"$t":"116346366931114012924"},"yt$replyCount":{"$t":1},"yt$videoid":{"$t":"ryJReIcMGOs"}},{"gd$etag":"W/\"D0IDQn47eCp7I2A9XRRXF0s.\"","id":{"$t":"tag:youtube.com,2008:video:ryJReIcMGOs:comment:z13hexfyzsigv5fd322qez1xupbbyvnee"},"published":{"$t":"2015-02-24T08:12:53.000Z"},"updated":{"$t":"2015-02-24T08:12:53.000Z"},"category":[{"scheme":"http://schemas.google.com/g/2005#kind","term":"http://gdata.youtube.com/schemas/2007#comment"}],"title":{"$t":"SGZ cricket..... ..."},"content":{"$t":"SGZ cricket..... grow up...\ufeff"},"link":[{"rel":"related","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs?v=2"},{"rel":"alternate","type":"text/html","href":"http://www.youtube.com/watch?v=ryJReIcMGOs"},{"rel":"self","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs/comments/z13hexfyzsigv5fd322qez1xupbbyvnee?v=2"}],"author":[{"name":{"$t":"Roshan More"},"uri":{"$t":"http://gdata.youtube.com/feeds/api/users/mZCY2FMCPkNn8RdNlPf0ww"},"yt$userId":{"$t":"mZCY2FMCPkNn8RdNlPf0ww"}}],"yt$channelId":{"$t":"UCmZCY2FMCPkNn8RdNlPf0ww"},"yt$googlePlusUserId":{"$t":"101759163693693799937"},"yt$replyCount":{"$t":0},"yt$videoid":{"$t":"ryJReIcMGOs"}},{"gd$etag":"W/\"AkYFQX47eCp7I2A9XRRWEE8.\"","id":{"$t":"tag:youtube.com,2008:video:ryJReIcMGOs:comment:z12yf5libtipzjki104cenrhvobhyftj2lk0k"},"published":{"$t":"2015-02-27T09:08:30.000Z"},"updated":{"$t":"2015-02-27T09:08:30.000Z"},"category":[{"scheme":"http://schemas.google.com/g/2005#kind","term":"http://gdata.youtube.com/schemas/2007#comment"}],"title":{"$t":"In this World cup ..."},"content":{"$t":"In this World cup each and every matches are interesting but only match \nschesule is not perfect ....\ufeff"},"link":[{"rel":"related","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs?v=2"},{"rel":"alternate","type":"text/html","href":"http://www.youtube.com/watch?v=ryJReIcMGOs"},{"rel":"self","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs/comments/z12yf5libtipzjki104cenrhvobhyftj2lk0k?v=2"}],"author":[{"name":{"$t":"Nikunj Goletar"},"uri":{"$t":"http://gdata.youtube.com/feeds/api/users/Shu6BVmlTRMgS_HtaB9yzQ"},"yt$userId":{"$t":"Shu6BVmlTRMgS_HtaB9yzQ"}}],"yt$channelId":{"$t":"UCShu6BVmlTRMgS_HtaB9yzQ"},"yt$googlePlusUserId":{"$t":"108529240828297091468"},"yt$replyCount":{"$t":0},"yt$videoid":{"$t":"ryJReIcMGOs"}},{"gd$etag":"W/\"DUYGQX47eCp7I2A9XRRXFk0.\"","id":{"$t":"tag:youtube.com,2008:video:ryJReIcMGOs:comment:z13juluxpmepddgrr04cjb2gnvvfhndyzp00k"},"published":{"$t":"2015-02-22T12:12:00.000Z"},"updated":{"$t":"2015-02-22T12:12:00.000Z"},"category":[{"scheme":"http://schemas.google.com/g/2005#kind","term":"http://gdata.youtube.com/schemas/2007#comment"}],"title":{"$t":"may i know the name ..."},"content":{"$t":"may i know the name of the game\ufeff"},"link":[{"rel":"related","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs?v=2"},{"rel":"alternate","type":"text/html","href":"http://www.youtube.com/watch?v=ryJReIcMGOs"},{"rel":"self","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs/comments/z13juluxpmepddgrr04cjb2gnvvfhndyzp00k?v=2"}],"author":[{"name":{"$t":"Gopinath V"},"uri":{"$t":"http://gdata.youtube.com/feeds/api/users/tamilanxxx"},"yt$userId":{"$t":"9Qu8ceBfkJ9txoCO3k3ENw"}}],"yt$channelId":{"$t":"UC9Qu8ceBfkJ9txoCO3k3ENw"},"yt$googlePlusUserId":{"$t":"115360643619137243306"},"yt$replyCount":{"$t":0},"yt$videoid":{"$t":"ryJReIcMGOs"}},{"gd$etag":"W/\"CUMBRH47eCp7I2A9XRRWEE4.\"","id":{"$t":"tag:youtube.com,2008:video:ryJReIcMGOs:comment:z13oyzgwvlroujxzu04cjjryjpyzwnmil54"},"published":{"$t":"2015-02-27T10:37:35.000Z"},"updated":{"$t":"2015-02-27T10:37:35.000Z"},"category":[{"scheme":"http://schemas.google.com/g/2005#kind","term":"http://gdata.youtube.com/schemas/2007#comment"}],"title":{"$t":"woooooooooooooooow\ufeff"},"content":{"$t":"woooooooooooooooow\ufeff"},"link":[{"rel":"related","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs?v=2"},{"rel":"alternate","type":"text/html","href":"http://www.youtube.com/watch?v=ryJReIcMGOs"},{"rel":"self","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs/comments/z13oyzgwvlroujxzu04cjjryjpyzwnmil54?v=2"}],"author":[{"name":{"$t":"Husnain shah"},"uri":{"$t":"http://gdata.youtube.com/feeds/api/users/__NO_YOUTUBE_ACCOUNT__"},"yt$userId":{"$t":"__NO_YOUTUBE_ACCOUNT__"}}],"yt$channelId":{"$t":"UC__NO_YOUTUBE_ACCOUNT__"},"yt$googlePlusUserId":{"$t":"113607893143655172508"},"yt$replyCount":{"$t":0},"yt$videoid":{"$t":"ryJReIcMGOs"}},{"gd$etag":"W/\"C0MDSX47eCp7I2A9XRRWEko.\"","id":{"$t":"tag:youtube.com,2008:video:ryJReIcMGOs:comment:z13mfpo41z3jebh2v22ggr5xtuqvyn2eo"},"published":{"$t":"2015-03-02T04:44:38.000Z"},"updated":{"$t":"2015-03-02T04:44:38.000Z"},"category":[{"scheme":"http://schemas.google.com/g/2005#kind","term":"http://gdata.youtube.com/schemas/2007#comment"}],"title":{"$t":"congrates\ufeff"},"content":{"$t":"congrates\ufeff"},"link":[{"rel":"related","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs?v=2"},{"rel":"alternate","type":"text/html","href":"http://www.youtube.com/watch?v=ryJReIcMGOs"},{"rel":"self","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs/comments/z13mfpo41z3jebh2v22ggr5xtuqvyn2eo?v=2"}],"author":[{"name":{"$t":"Amol Awasthi"},"uri":{"$t":"http://gdata.youtube.com/feeds/api/users/THBPSc-ik_m440Djkhe0ew"},"yt$userId":{"$t":"THBPSc-ik_m440Djkhe0ew"}}],"yt$channelId":{"$t":"UCTHBPSc-ik_m440Djkhe0ew"},"yt$googlePlusUserId":{"$t":"118383318670254507980"},"yt$replyCount":{"$t":0},"yt$videoid":{"$t":"ryJReIcMGOs"}},{"gd$etag":"W/\"DUMERn47eCp7I2A9XRRWEE8.\"","id":{"$t":"tag:youtube.com,2008:video:ryJReIcMGOs:comment:z13bs11qzp2kjvpsj22ecvjb5ouvh1ilb"},"published":{"$t":"2015-02-27T08:56:47.000Z"},"updated":{"$t":"2015-02-27T08:56:47.000Z"},"category":[{"scheme":"http://schemas.google.com/g/2005#kind","term":"http://gdata.youtube.com/schemas/2007#comment"}],"title":{"$t":"haha you are the ..."},"content":{"$t":"haha you are the world fellow ever\ufeff"},"link":[{"rel":"related","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs?v=2"},{"rel":"alternate","type":"text/html","href":"http://www.youtube.com/watch?v=ryJReIcMGOs"},{"rel":"self","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs/comments/z13bs11qzp2kjvpsj22ecvjb5ouvh1ilb?v=2"}],"author":[{"name":{"$t":"nani98663"},"uri":{"$t":"http://gdata.youtube.com/feeds/api/users/nani98663"},"yt$userId":{"$t":"_oMue9jTfGX75AQUxeceiw"}}],"yt$channelId":{"$t":"UC_oMue9jTfGX75AQUxeceiw"},"yt$googlePlusUserId":{"$t":"115292334965355156920"},"yt$replyCount":{"$t":0},"yt$videoid":{"$t":"ryJReIcMGOs"}},{"gd$etag":"W/\"DkYMQX47eCp7I2A9XRRXGEQ.\"","id":{"$t":"tag:youtube.com,2008:video:ryJReIcMGOs:comment:z12th1ditzvedbxsp22kxxlzeuucfbrcw"},"published":{"$t":"2015-02-25T19:56:20.000Z"},"updated":{"$t":"2015-02-25T19:56:20.000Z"},"category":[{"scheme":"http://schemas.google.com/g/2005#kind","term":"http://gdata.youtube.com/schemas/2007#comment"}],"title":{"$t":"seriously grow up ..."},"content":{"$t":"seriously grow up man\ufeff"},"link":[{"rel":"related","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs?v=2"},{"rel":"alternate","type":"text/html","href":"http://www.youtube.com/watch?v=ryJReIcMGOs"},{"rel":"self","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs/comments/z12th1ditzvedbxsp22kxxlzeuucfbrcw?v=2"}],"author":[{"name":{"$t":"Ishan Shinde"},"uri":{"$t":"http://gdata.youtube.com/feeds/api/users/5nefuBa-wS5dlh9mthIsQQ"},"yt$userId":{"$t":"5nefuBa-wS5dlh9mthIsQQ"}}],"yt$channelId":{"$t":"UC5nefuBa-wS5dlh9mthIsQQ"},"yt$googlePlusUserId":{"$t":"115372824146721655757"},"yt$replyCount":{"$t":0},"yt$videoid":{"$t":"ryJReIcMGOs"}},{"gd$etag":"W/\"A0YNSX47eCp7I2A9XRRXF00.\"","id":{"$t":"tag:youtube.com,2008:video:ryJReIcMGOs:comment:z13pgp5yirr0wtxik04civwpimrcerapvek"},"published":{"$t":"2015-02-23T16:33:18.000Z"},"updated":{"$t":"2015-02-23T16:33:18.000Z"},"category":[{"scheme":"http://schemas.google.com/g/2005#kind","term":"http://gdata.youtube.com/schemas/2007#comment"}],"title":{"$t":"hell no.... how ..."},"content":{"$t":"hell no.... how interesting....lol\ufeff"},"link":[{"rel":"related","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs?v=2"},{"rel":"alternate","type":"text/html","href":"http://www.youtube.com/watch?v=ryJReIcMGOs"},{"rel":"self","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs/comments/z13pgp5yirr0wtxik04civwpimrcerapvek?v=2"}],"author":[{"name":{"$t":"Darshan Jain"},"uri":{"$t":"http://gdata.youtube.com/feeds/api/users/TmQQ8VHwustduwHXiLowWg"},"yt$userId":{"$t":"TmQQ8VHwustduwHXiLowWg"}}],"yt$channelId":{"$t":"UCTmQQ8VHwustduwHXiLowWg"},"yt$googlePlusUserId":{"$t":"116504884552174068967"},"yt$replyCount":{"$t":0},"yt$videoid":{"$t":"ryJReIcMGOs"}},{"gd$etag":"W/\"DEMER347eCp7I2A9XRRXGEQ.\"","id":{"$t":"tag:youtube.com,2008:video:ryJReIcMGOs:comment:z13utrm4zyjgwd20n22tfnzqzvuehh5lc"},"published":{"$t":"2015-02-25T20:33:26.000Z"},"updated":{"$t":"2015-02-25T20:33:26.000Z"},"category":[{"scheme":"http://schemas.google.com/g/2005#kind","term":"http://gdata.youtube.com/schemas/2007#comment"}],"title":{"$t":"Grow up friend\ufeff"},"content":{"$t":"Grow up friend\ufeff"},"link":[{"rel":"related","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs?v=2"},{"rel":"alternate","type":"text/html","href":"http://www.youtube.com/watch?v=ryJReIcMGOs"},{"rel":"self","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs/comments/z13utrm4zyjgwd20n22tfnzqzvuehh5lc?v=2"}],"author":[{"name":{"$t":"abhijit kulkarni"},"uri":{"$t":"http://gdata.youtube.com/feeds/api/users/abhijit0727"},"yt$userId":{"$t":"NWvmyhNFs1B8ljeaQXES1A"}}],"yt$channelId":{"$t":"UCNWvmyhNFs1B8ljeaQXES1A"},"yt$googlePlusUserId":{"$t":"105890333904958496583"},"yt$replyCount":{"$t":0},"yt$videoid":{"$t":"ryJReIcMGOs"}},{"gd$etag":"W/\"D04DQ347eCp7I2A9XRRXF08.\"","id":{"$t":"tag:youtube.com,2008:video:ryJReIcMGOs:comment:z12wxpvrlofxc5s0w23ownp4doe4wrx4r04"},"published":{"$t":"2015-02-23T21:12:52.000Z"},"updated":{"$t":"2015-02-23T21:12:52.000Z"},"category":[{"scheme":"http://schemas.google.com/g/2005#kind","term":"http://gdata.youtube.com/schemas/2007#comment"}],"title":{"$t":"wow the crowd sucks ..."},"content":{"$t":"wow the crowd sucks in this game\ufeff"},"link":[{"rel":"related","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs?v=2"},{"rel":"alternate","type":"text/html","href":"http://www.youtube.com/watch?v=ryJReIcMGOs"},{"rel":"self","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs/comments/z12wxpvrlofxc5s0w23ownp4doe4wrx4r04?v=2"}],"author":[{"name":{"$t":"Mehul Shukla"},"uri":{"$t":"http://gdata.youtube.com/feeds/api/users/mehulshukla04"},"yt$userId":{"$t":"xu8mQo6LHTGfYAG-j7mNug"}}],"yt$channelId":{"$t":"UCxu8mQo6LHTGfYAG-j7mNug"},"yt$googlePlusUserId":{"$t":"105925848190989770553"},"yt$replyCount":{"$t":0},"yt$videoid":{"$t":"ryJReIcMGOs"}},{"gd$etag":"W/\"A08BQ347eCp7I2A9XRRXF0g.\"","id":{"$t":"tag:youtube.com,2008:video:ryJReIcMGOs:comment:z12wf3irhvr5sbbjq04ccx4rtz24yveq25k"},"published":{"$t":"2015-02-24T06:37:32.000Z"},"updated":{"$t":"2015-02-24T06:37:32.000Z"},"category":[{"scheme":"http://schemas.google.com/g/2005#kind","term":"http://gdata.youtube.com/schemas/2007#comment"}],"title":{"$t":"can u tell the name ..."},"content":{"$t":"can u tell the name of the game plss??????\ufeff"},"link":[{"rel":"related","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs?v=2"},{"rel":"alternate","type":"text/html","href":"http://www.youtube.com/watch?v=ryJReIcMGOs"},{"rel":"self","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs/comments/z12wf3irhvr5sbbjq04ccx4rtz24yveq25k?v=2"}],"author":[{"name":{"$t":"nikhil kulal"},"uri":{"$t":"http://gdata.youtube.com/feeds/api/users/HZacepyCMUAS5AzaKPImwA"},"yt$userId":{"$t":"HZacepyCMUAS5AzaKPImwA"}}],"yt$channelId":{"$t":"UCHZacepyCMUAS5AzaKPImwA"},"yt$googlePlusUserId":{"$t":"103284323473829074041"},"yt$replyCount":{"$t":0},"yt$videoid":{"$t":"ryJReIcMGOs"}},{"gd$etag":"W/\"D04FRX47eCp7I2A9XRRXFkQ.\"","id":{"$t":"tag:youtube.com,2008:video:ryJReIcMGOs:comment:z125irwomybbexbvj23dwxqgbtbdyf0nc"},"published":{"$t":"2015-02-23T12:51:54.000Z"},"updated":{"$t":"2015-02-23T12:51:54.000Z"},"category":[{"scheme":"http://schemas.google.com/g/2005#kind","term":"http://gdata.youtube.com/schemas/2007#comment"}],"title":{"$t":"woow vata game\ufeff"},"content":{"$t":"woow vata game\ufeff"},"link":[{"rel":"related","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs?v=2"},{"rel":"alternate","type":"text/html","href":"http://www.youtube.com/watch?v=ryJReIcMGOs"},{"rel":"self","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs/comments/z125irwomybbexbvj23dwxqgbtbdyf0nc?v=2"}],"author":[{"name":{"$t":"pradeep appu"},"uri":{"$t":"http://gdata.youtube.com/feeds/api/users/7j-ZZrFk6CylNMihVsV1vQ"},"yt$userId":{"$t":"7j-ZZrFk6CylNMihVsV1vQ"}}],"yt$channelId":{"$t":"UC7j-ZZrFk6CylNMihVsV1vQ"},"yt$googlePlusUserId":{"$t":"116605829416262485807"},"yt$replyCount":{"$t":0},"yt$videoid":{"$t":"ryJReIcMGOs"}},{"gd$etag":"W/\"AkUNQn47eCp7I2A9XRRWEEo.\"","id":{"$t":"tag:youtube.com,2008:video:ryJReIcMGOs:comment:z121c51wuquciznns230yxnorkb2x34ai04"},"published":{"$t":"2015-02-27T23:04:53.000Z"},"updated":{"$t":"2015-02-27T23:04:53.000Z"},"category":[{"scheme":"http://schemas.google.com/g/2005#kind","term":"http://gdata.youtube.com/schemas/2007#comment"}],"title":{"$t":"superhero..indian . ..."},"content":{"$t":"superhero..indian ..jai ho\ufeff"},"link":[{"rel":"related","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs?v=2"},{"rel":"alternate","type":"text/html","href":"http://www.youtube.com/watch?v=ryJReIcMGOs"},{"rel":"self","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs/comments/z121c51wuquciznns230yxnorkb2x34ai04?v=2"}],"author":[{"name":{"$t":"chupbhosari terabaap"},"uri":{"$t":"http://gdata.youtube.com/feeds/api/users/80XYP3ohlonHxFjyJxMg9w"},"yt$userId":{"$t":"80XYP3ohlonHxFjyJxMg9w"}}],"yt$channelId":{"$t":"UC80XYP3ohlonHxFjyJxMg9w"},"yt$googlePlusUserId":{"$t":"107946096902915779887"},"yt$replyCount":{"$t":0},"yt$videoid":{"$t":"ryJReIcMGOs"}},{"gd$etag":"W/\"AkEGR347eCp7I2A9XRRXFkQ.\"","id":{"$t":"tag:youtube.com,2008:video:ryJReIcMGOs:comment:z13scpvijxithh0lm23dxpa5vkzsw50a304"},"published":{"$t":"2015-02-23T13:37:06.000Z"},"updated":{"$t":"2015-02-23T13:37:06.000Z"},"category":[{"scheme":"http://schemas.google.com/g/2005#kind","term":"http://gdata.youtube.com/schemas/2007#comment"}],"title":{"$t":"good\ufeff"},"content":{"$t":"good\ufeff"},"link":[{"rel":"related","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs?v=2"},{"rel":"alternate","type":"text/html","href":"http://www.youtube.com/watch?v=ryJReIcMGOs"},{"rel":"self","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs/comments/z13scpvijxithh0lm23dxpa5vkzsw50a304?v=2"}],"author":[{"name":{"$t":"Maha Linagam"},"uri":{"$t":"http://gdata.youtube.com/feeds/api/users/mali4991"},"yt$userId":{"$t":"4NyMEDI3PVTVEM9Fga-K5Q"}}],"yt$channelId":{"$t":"UC4NyMEDI3PVTVEM9Fga-K5Q"},"yt$googlePlusUserId":{"$t":"103431499595674948971"},"yt$replyCount":{"$t":0},"yt$videoid":{"$t":"ryJReIcMGOs"}},{"gd$etag":"W/\"DUAFRH47eCp7I2A9XRRXF00.\"","id":{"$t":"tag:youtube.com,2008:video:ryJReIcMGOs:comment:z12nxdegiqzecxljo04chvn4dkzmuvwgdr00k"},"published":{"$t":"2015-02-23T16:08:35.000Z"},"updated":{"$t":"2015-02-23T16:08:35.000Z"},"category":[{"scheme":"http://schemas.google.com/g/2005#kind","term":"http://gdata.youtube.com/schemas/2007#comment"}],"title":{"$t":"dafuq is this???\ufeff"},"content":{"$t":"dafuq is this???\ufeff"},"link":[{"rel":"related","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs?v=2"},{"rel":"alternate","type":"text/html","href":"http://www.youtube.com/watch?v=ryJReIcMGOs"},{"rel":"self","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs/comments/z12nxdegiqzecxljo04chvn4dkzmuvwgdr00k?v=2"}],"author":[{"name":{"$t":"Katherine May"},"uri":{"$t":"http://gdata.youtube.com/feeds/api/users/Vvt17yrrm4cwZT5HakoHFw"},"yt$userId":{"$t":"Vvt17yrrm4cwZT5HakoHFw"}}],"yt$channelId":{"$t":"UCVvt17yrrm4cwZT5HakoHFw"},"yt$googlePlusUserId":{"$t":"105114308315934876966"},"yt$replyCount":{"$t":0},"yt$videoid":{"$t":"ryJReIcMGOs"}},{"gd$etag":"W/\"CkIDSH47eCp7I2A9XRRXGUg.\"","id":{"$t":"tag:youtube.com,2008:video:ryJReIcMGOs:comment:z12detpbmozjc5dms23csd4rkyvgsvnok04"},"published":{"$t":"2015-02-26T11:36:19.000Z"},"updated":{"$t":"2015-02-26T11:36:19.000Z"},"category":[{"scheme":"http://schemas.google.com/g/2005#kind","term":"http://gdata.youtube.com/schemas/2007#comment"}],"title":{"$t":""},"content":{"$t":""},"link":[{"rel":"related","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs?v=2"},{"rel":"alternate","type":"text/html","href":"http://www.youtube.com/watch?v=ryJReIcMGOs"},{"rel":"self","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs/comments/z12detpbmozjc5dms23csd4rkyvgsvnok04?v=2"}],"author":[{"name":{"$t":"Ashokkumar T"},"uri":{"$t":"http://gdata.youtube.com/feeds/api/users/3kFgr6i5Ugr7aIYEZvU-Iw"},"yt$userId":{"$t":"3kFgr6i5Ugr7aIYEZvU-Iw"}}],"yt$channelId":{"$t":"UC3kFgr6i5Ugr7aIYEZvU-Iw"},"yt$googlePlusUserId":{"$t":"101665337513199560569"},"yt$replyCount":{"$t":0},"yt$videoid":{"$t":"ryJReIcMGOs"}},{"gd$etag":"W/\"C0ANQn47eCp7I2A9XRRWEUQ.\"","id":{"$t":"tag:youtube.com,2008:video:ryJReIcMGOs:comment:z12uy31y3weyelzop04cgnoyloukhpvrcrs0k"},"published":{"$t":"2015-03-01T06:36:33.000Z"},"updated":{"$t":"2015-03-01T06:36:33.000Z"},"category":[{"scheme":"http://schemas.google.com/g/2005#kind","term":"http://gdata.youtube.com/schemas/2007#comment"}],"title":{"$t":"New inspiring song ..."},"content":{"$t":"New inspiring song for team india to win the world cup\nhttps://www.youtube.com/watch?v=vxNf1m2SiY0\ufeff"},"link":[{"rel":"related","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs?v=2"},{"rel":"alternate","type":"text/html","href":"http://www.youtube.com/watch?v=ryJReIcMGOs"},{"rel":"self","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ryJReIcMGOs/comments/z12uy31y3weyelzop04cgnoyloukhpvrcrs0k?v=2"}],"author":[{"name":{"$t":"Kumar K"},"uri":{"$t":"http://gdata.youtube.com/feeds/api/users/X0WlKnTMzGDgVDZ4TmWujQ"},"yt$userId":{"$t":"X0WlKnTMzGDgVDZ4TmWujQ"}}],"yt$channelId":{"$t":"UCX0WlKnTMzGDgVDZ4TmWujQ"},"yt$googlePlusUserId":{"$t":"116638980038801195984"},"yt$replyCount":{"$t":0},"yt$videoid":{"$t":"ryJReIcMGOs"}}]}}


Best Related Posts are Following:
1. How to send Email in Zend Framework - HTML Email
2. Send Email from Gmail SMTP using Zend Framework
3. Google trends api php - How to get hot trends
4. Multiple column ordering in Zend Framework
5. Current time zone for a city- Free API
6. Zend Gdata Youtube API - Search Video - View Video Detail
7. Download Videos from Amazon S3 - PHP
8. How to set Cron in Zend Framework
9. Zend Cache Tutorial - Zend Framework 1.12
10. Zend Framework Interview Questions and Answers for Experienced

Tuesday 13 January 2015

How to create webservice in php with SOAP Technology

How to create webservice in php with SOAP Technology

Here we will learn how to create a SOAP based web service and know how to use a web service created with SOAP.

For creating webservice you must know the basics of following.
What is Web Services
Web Services is Interaction between two machines over a network. It use SOAP, REST, and XML-RPC as a means of communication. A Web service always needs a network for its operation.
Know Difference between WebService and API


What is SOAP
SOAP stands for Simple Object Access Protocol. SOAP is an XML-based protocol for exchanging information between two computers over the internet. It enables you to Remote Procedure Calls (RPC) transported via HTTP.
More About SOAP


Now Follow the following Simple Steps:
1. Donwnload the library File from http://sourceforge.net/projects/nusoap/.
2. Unzip/extract the downloaded zip file.
3. Copy the "lib" folder from unziped folder and past in root folder of your project.
   Suppose your project is myproject:
   Project Location: D:\wamp\www\myproject
   Library Location: D:\wamp\www\myproject\lib
4.Create two files soapServer.php and soapClient.php into myproject folder.
5. Add Following code in soapServer.php
/* Include library file **/ 
require_once ('lib/nusoap.php'); 

/** create the object of SoapServer **/
$serverObj = new soap_server;
$namespace = 'http://localhost/myproject/soapServer.php?wsdl';
$serverObj->configureWSDL('get_messageString', $namespace); 

//register a function that works on server 
$serverObj->register('get_message'); 

// create the function 
function get_message($your_name) 
{ 
return "Hello {$your_name}!"; 
} 

if ( !isset( $HTTP_RAW_POST_DATA ) ){
  $HTTP_RAW_POST_DATA =file_get_contents('php://input' );
} 
// create HTTP listener 
$serverObj->service($HTTP_RAW_POST_DATA);


6. Add Following code in soapClient.php
require_once ('lib/nusoap.php'); 
//Give it value at parameter 
$param = array( 'your_name' => 'Web Technology Experts Notes');

try{
      //Create object that referer a web services 
    $clientObj = new soapclient('http://localhost/myproject/soapServer.php'); 
    //Call a function at server and send parameters too 
    $response = $clientObj->call('get_message',$param); 
    //Process result 
    if($clientObj->fault){ 
      echo "FAULT: Code: ($clientObj->faultcode)"; 
      echo "String: ".$clientObj->faultstring; 
    }else { 
      echo $response; 
      } 
}catch(Exception $e){
    echo $e->getMessage();
}   

7. soapClient.php will use as client whereas soapServer.php will be used as server.

Wednesday 24 December 2014

Facebook comments Integration in website

Facebook comments box for website



Add Following code in your website, Facebook comment will start working.





<div id="fb-root"> </div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.0"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> <div class="fb-comments" data-colorscheme="light" data-href="http://www.web-technology-experts-notes.in/2014/12/facebook-comments-box-for-website.html" data-numposts="5" width="700"> </div>
See Demo:






You can manage following Options in Facebook Comment Box.
1. data-colorscheme: Color scheme used by the plugin. Can be "light" or "dark".
Option: light|dark

2. data-href: This is comment page URL, you can also add dynamic page URL. Add Website Address bar URL like http://dev.georama.loc/comment.php

3. data-numposts: Total no of comments wants to display at the time of page load.
default:5

4. width: Total widths of facebook comments box
default:550

Monday 24 November 2014

How to setup your twitter App?

How to setup your twitter App?

Setup your App in Twitter.com

  1. Login to https://twitter.com (If Not registered, please register first)
  2. Add Mobile Number and verify (https://twitter.com/settings/devices)
  3. Go to Manage Apps page (i.e https://apps.twitter.com/)
  4. Create a New App
  5. Fill all required info
  6. In "What type of access does your application need" set "Read and write"
  7. Save API Key and API secret (Consumer key and Consumer Secret key)


Follow PHP Work from Below sites(I have test this, Its working)



Friday 14 November 2014

Current time zone for a city- Free API

Current time zone for a city- Free API

Get TimeZone & Local time from Latitude/Longitude



$localtime = 0;
$latitude = '40.71417';
$longitude = '-74.00639';
try {
    $client = new Zend_Http_Client('http://www.earthtools.org/timezone-1.1/' . $latitude . '/' . $longitude);
    $response = $client->request('GET');
    $xmlData = $response->getBody();
    if (!empty($xmlData)) {
        $xmlData = simplexml_load_string($xmlData);  
        print_r($xmlData);
    }

} catch (Exception $e) {
    echo 'Error' . $e->getMessage();
}

Output:

SimpleXMLElement Object
(
    [version] => 1.0
    [location] => SimpleXMLElement Object
        (
            [latitude] => 40.71417
            [longitude] => -74.00639
        )
    [offset] => -5
    [suffix] => R
    [localtime] => 13 Nov 2014 01:42:07
    [isotime] => 2014-11-13 01:42:07 -0500
    [utctime] => 2014-11-13 06:42:07
    [dst] => Unknown
)


Get Latitude/Longitude from address


http://maps.googleapis.com/maps/api/geocode/json?address=chandigarh&sensor=false

Output:
http://maps.googleapis.com/maps/api/geocode/json?address=chandigarh&sensor=false



Monday 27 October 2014

Zend Gdata Youtube API - Search Video - View Video Detail

Zend Gdata Youtube API - Search Video - View Video Detail

Youtube API is very useful to show the youtube videos in your website. You don't required any account for search the video. You can filter the video by query string, category, limit no of records & you can see even video detail.
You can also upload OR do changes in uploaded videos but for this you need youtube account.On the behalf of my experience I am presenting some easy example which let you understand the youtube API. These example are testing with zend framework 1.12. Please let me your thoughts on this...



Search Videos by Category
$yt = new Zend_Gdata_YouTube();
$query = $yt->newVideoQuery();
$query->category = 'Comedy/dog';
//$query->setCategory('Comedy/dog'); OR 
$videos = $yt->getVideoFeed($query);
$this->printVideoFeed($videos);


Search Videos by query string
$yt = new Zend_Gdata_YouTube();
$query = $yt->newVideoQuery();
$query->videoQuery = 'dogs';
$videos = $yt->getVideoFeed($query);
$this->printVideoFeed($videos);


List Top Rated Videos
$yt = new Zend_Gdata_YouTube();
$videos = $yt->getTopRatedVideoFeed();
$this->printVideoFeed($videos);


List Today's Top Rated Videos
$yt = new Zend_Gdata_YouTube();
$query = $yt->newVideoQuery();
$query->setTime('today');
$videos = $yt->getVideoFeed($query);
$this->printVideoFeed($videos);


List videos by viewCount & Add limit
$yt = new Zend_Gdata_YouTube();
$query = $yt->newVideoQuery();
$query->orderBy = 'viewCount';
$query->startIndex = 10;
$query->maxResults = 20;
$videos = $yt->getVideoFeed($query);
$this->printVideoFeed($videos);



Example In Zend Framework 
class IndexController extends Zend_Controller_Action {

    public function init() {
        /* Initialize action controller here */
    }

    public function indexAction() {

        // action body
    }

    function printVideoFeed($videoFeed) {
        foreach ($videoFeed as $videoEntry) {
            $this->printVideoEntry($videoEntry);
        }
    }

    function printVideoEntry($videoEntry) {
        echo '\n Video: ' . $videoEntry->getVideoTitle();
        echo '\n Video ID: ' . $videoEntry->getVideoId();
        echo '\n Updated: ' . $videoEntry->getUpdated();
        echo '\n Description: ' . $videoEntry->getVideoDescription();
        echo '\n Category: ' . $videoEntry->getVideoCategory();
        echo '\n Tags: ' . implode(", ", $videoEntry->getVideoTags());
        echo '\n Watch page: ' . $videoEntry->getVideoWatchPageUrl();
        echo '\n Flash Player Url: ' . $videoEntry->getFlashPlayerUrl();
        echo '\n Duration: ' . $videoEntry->getVideoDuration();
        echo '\n View count: ' . $videoEntry->getVideoViewCount();
        echo '\n Rating: ' . $videoEntry->getVideoRatingInfo();
        echo '\n Geo Location: ' . $videoEntry->getVideoGeoLocation();
        echo '\n Recorded on: ' . $videoEntry->getVideoRecorded();

        foreach ($videoEntry->mediaGroup->content as $content) {
            if ($content->type === "video/3gpp") {
                echo '
 Mobile RTSP link: ' . $content->url;
            }            
        }
        echo "\n\n";
    }

    function youtubeAction() {
        $yt = new Zend_Gdata_YouTube();
        $query = $yt->newVideoQuery();
        $query->category = 'Comedy/dog';
        //$query->setCategory('Comedy/dog'); OR 
        $videos = $yt->getVideoFeed($query);
        $this->printVideoFeed($videos);
        die("");
    }

}

Execute:/index/youtube


Output:
Video: My 200th Video
Video ID: h23oPnh1WJM
Updated: 2014-10-27T00:30:41.000Z
Description: Please subscribe to my channel and my vlog channel! I make new videos here every Wednesday and make vlogs during my majestical daily life. JennaMarbles Jenna...
Category: Comedy
Tags:
Watch page: https://www.youtube.com/watch?v=h23oPnh1WJM&feature=youtube_gdata_player
Flash Player Url: https://www.youtube.com/v/h23oPnh1WJM?version=3&f=videos&app=youtube_gdata
Duration: 263
View count: 3640139
Rating: Array
Geo Location:
Recorded on:
Mobile RTSP link: rtsp://r6---sn-p5qlsu76.c.youtube.com/CiILENy73wIaGQmTWHV4PuhthxMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp
Mobile RTSP link: rtsp://r6---sn-p5qlsu76.c.youtube.com/CiILENy73wIaGQmTWHV4PuhthxMYESARFEgGUgZ2aWRlb3MM/0/0/0/video.3gp