Posts: 2
Threads: 1
Joined: Jun 2014
Reputation:
0
06-02-2014, 03:27 AM
(This post was last modified: 06-02-2014, 03:28 AM by EK013.)
Where can i find last stable version of Wired "framework", please? I always get an errors even trying to execute example code.
Errors like:
PHP Code: Fatal error: Call to a member function get_facility() on a non-object in /public_html/app/lib/wiredx.php on line 693
Code:
PHP Code: $wubook= new WuBook(); $wubook->init_wubook('EK013', '00000', 'https://wubook.net:443/xrws/'); $cust= create_wbcustomer('mario', 'rossi', 'via via', 'city', 'IT', 'mymail@addre.ss', '333333', '12:34', 'My Remarks'); $cc= create_wbcc(1, '43423423421234', 'mario rossi', '11', '2009', '870'); $res= $wubook->book_now(1401186213, $cust, $cc);
As you can see this is standard example… What am i doing wrong?
Another example:
PHP Code: Fatal error: Call to a member function arraymem() on a non-object in /public_html/app/lib/wiredx.php on line 222
Code:
PHP Code: $wubook= new WuBook(); $wubook->init_wubook('EK013', '00000', 'https://wubook.net:443/xrws/'); $myfacs= array(1401186213); $wbf= $wubook->facilities_request($myfacs, '12/08/2009', '15/08/2009');
Trying to do something with these errors second day. Downloaded Wired from wubook.net and xmlrpc.inc from official website.
Really need help.
Posts: 45
Threads: 8
Joined: Apr 2013
Reputation:
0
Hello,
the PHP client you have downloaded on our site is a very old sample. Wired must be considered stable, we receive ~1 milion queries / day and it's a core service!!!
But we have dropped from years the version of Wired to allow third parts to develop a booking engine. So, it seems you're using an old library which uses a not existent service.
If you need to develop an engine, check the Fount system and the Alien Plugin. Some links:
- Wired / Alien docs: https://sites.google.com/site/wubookdocs/wired
- Fount docs: https://sites.google.com/site/wubookdocs...book-fount
I'm sorry for the misunderstanding. Let me know if I can help you
Posts: 2
Threads: 1
Joined: Jun 2014
Reputation:
0
06-04-2014, 07:11 AM
(This post was last modified: 06-04-2014, 07:16 PM by EK013.)
Thanks for info, i've already realized that even the host url is obsolete. I've started to develop own library based on documentation here:
https://sites.google.com/site/wubookdocs...l-examples
It can manage rooms, prices for defined dates already.
If you are interested i can send it when it will be ready or, if you open for me a repository, we can develop it together.
Here is first lines of it as example:
(any critics, advices, notices will be appreciated!)
PHP Code: <? //class KitWuBook
class KitWuBook { //vars // private $var = 'default'; const HOST = 'https://wubook.net:443/xrws/';
private $srv; private $acc; private $pwd; private $lcd;
private $err;
//init //username, password, enviroment - are usual parameters //$lcode = Facility ID, you can find it on Facility->Site tab in WuBook //For each facility you will need to create separate object function __construct($username, $password, $lcode) { $this->srv = new xmlrpc_client(self::HOST); $this->srv->setSSLVerifyPeer(0);
$this->acc = $username; $this->pwd = $password; $this->lcd = (int)$lcode;
$this->err = ''; }
//methods
//gets the token needed for every xmlrpc query private function get_token(){ $msg = new xmlrpcmsg('get_token', array(new xmlrpcval($this->acc, 'string'), new xmlrpcval($this->pwd, 'string')));
$token = $this->srv->send($msg)->serialize()[1];
return $token; }
//fetches all rooms, attached to current facility //result does not consist a price public function fetch_rooms(){
$tok = new xmlrpcval($this->get_token(), 'string'); $lcd = new xmlrpcval($this->lcd, 'int');
$msg= new xmlrpcmsg('fetch_rooms', array($tok, $lcd)); $struct = $this->srv->send($msg);
$rooms = xmlrpc_decode($struct->serialize())[1];
return $rooms; }
//fetches defined rooms values or returns all rooms values if not defined last parameter public function fetch_rooms_values($fromDate, $toDate, $rooms = array()){ $tok = new xmlrpcval($this->get_token(), 'string'); $lcd = new xmlrpcval($this->lcd, 'int'); $frd = new xmlrpcval($fromDate, 'string'); $tod = new xmlrpcval($toDate, 'string');
if(sizeof($rooms)>0){ $rms = new xmlrpcval($rooms, 'array'); $msg= new xmlrpcmsg('fetch_rooms_values', array($tok, $lcd, $frd, $tod, $rms)); }else{ $msg= new xmlrpcmsg('fetch_rooms_values', array($tok, $lcd, $frd, $tod)); } $rooms_values = xmlrpc_decode($this->srv->send($msg)->serialize())[1];
return $rooms_values; }
//sets new room values //for now works only with 1 defined room public function update_rooms_values($fromDate, $roomId, $newPrice, $min_stay = 1, $avail = 1){ $tok = new xmlrpcval($this->get_token(), 'string'); $lcd = new xmlrpcval($this->lcd, 'int'); $frd = new xmlrpcval($fromDate, 'string'); $rid = new xmlrpcval($roomId, 'int'); $prc = new xmlrpcval($newPrice, 'double'); $avl = new xmlrpcval($avail, 'int'); $mst = new xmlrpcval($min_stay, 'int');
$rms = new xmlrpcval( array(new xmlrpcval( array( 'id' => $rid, 'days' => new xmlrpcval( array( new xmlrpcval( array( 'avail' => $avl, 'price' => $prc ), 'struct'), new xmlrpcval( array( 'min_stay' => $mst ), 'struct') ), 'array') ),'struct') ) , 'array');
$msg= new xmlrpcmsg('update_rooms_values', array($tok, $lcd, $frd, $rms)); $answer = xmlrpc_decode($this->srv->send($msg)->serialize());
return $answer; }
...
Posts: 45
Threads: 8
Joined: Apr 2013
Reputation:
0
Oh,
it would be nice to develop an abstract PHP library for Wired. Can we eventually work on Github? If you have an account, feel free to publish your library there. And if you will alert us, for sure I will follow the project with my Github account. Or let me know how you prefere to go on!!
Posts: 6
Threads: 1
Joined: Oct 2014
Reputation:
0
Good, but what about push request-answer.
does anyone have examples?
Posts: 1
Threads: 0
Joined: Sep 2014
Reputation:
0
10-16-2014, 08:02 AM
(This post was last modified: 10-16-2014, 08:02 AM by DS051.)
(10-16-2014, 02:20 AM)PI005 Wrote: Good, but what about push request-answer.
does anyone have examples?
Since then we forced the progress on our project, so we didn't finished this library. Unfortunately, we haven't more examples that these. But when we will continue our work for Wired! I can swear to contribute our code to public.
(10-16-2014, 02:20 AM)PI005 Wrote: Good, but what about push request-answer.
does anyone have examples?
Since then we forced the progress on our project, so we didn't finished this library. Unfortunately, we haven't more examples that these. But when we will continue our work for Wired! I can swear to contribute our code to public.
Posts: 10
Threads: 0
Joined: Mar 2013
Reputation:
0
Hi! We don't have more examples of those already published. All requests are documented here: https://sites.google.com/site/wubookdocs/wired
If you have some particular request, please ask: we're glad to help!
|