sajjad.eskandary
چهارشنبه 26 مهر 1396, 10:09 صبح
سلام
من دارم با SoapServer کار میکنم. endpoint رو ساختم. الان نیاز هست که فایل wsdl رو بسازم تا بتونم کارم رو ادامه بدم.
در واقع از کد زیر میخوام wsdl بسازم ..
کسی میتونه راهنمایی کنه ؟
با تشکر
class server{
private $UserIdSender;
private $UserIdReciver;
private $Title;
private $Body;
private $BoardId;
private $obj_ticket;
private $obj_ticket_owner;
private $ticket_id;
public function __construct() {
date_default_timezone_set("Asia/Tehran");
require_once "../../diba-modules/conf.php";
require_once "../../diba-modules/functions.php";
require_once "../../diba-include/entities/ticket.php";
require_once "../../diba-include/entities/ticket_owner.php";
$this->obj_ticket = new \entities\ticket(TRUE);
$this->obj_ticket_owner = new \entities\ticket_owner(TRUE);
mb_internal_encoding("UTF-8");
}
/*public board = 17*/
public function SaveTicketFromPortal($Token,$NationalCodeSender , $NationalCodeReciver , $Title , $Body = "" , $BoardId = 17 ){
$this->UserIdSender = get_id_from_national_code($NationalCodeSender);
$this->UserIdReciver = get_id_from_national_code($NationalCodeReciver);
$this->Title = trim(filter_var($Title,FILTER_SANITIZE_STRING));
$this->Body = trim(filter_var($Body,FILTER_SANITIZE_STRING));
$this->BoardId = filter_var($BoardId,FILTER_SANITIZE_NUMBER_INT);
if($this->UserIdSender <= 0 ){
return array("Success" => "-1" , "Message" => "Sender NationalCode Not Found !" );
}elseif($this->UserIdReciver <= 0 ){
return array("Success" => "-1" , "Message" => "Reciver NationalCode Not Found !" );
} elseif(mb_strlen($this->Title)>500){
return array("Success" => "-1" , "Message" => "OverFlow in Ticket Title Variable! Type Of Variable Is String(500) " );
}elseif(mb_strlen($this->Body)>3000){
return array("Success" => "-1" , "Message" => "OverFlow in Ticket Body Variable! Type Of Variable Is String(3000) " );
}elseif(!is_numeric($this->BoardId) ){
return array("Success" => "-1" , "Message" => "BoardId Should Be Number!" );
}else{
$this->ticket_id = $this->obj_ticket->save(NULL, $this->Title, $this->Body, $this->UserIdSender , date("Y-m-d H:i:s"), "" , 3 , 0 , $this->BoardId);
$this->obj_ticket_owner->save(NULL, $this->ticket_id, $this->UserIdReciver, date("Y-m-d H:i:s"), 3, 0, 1);
if($this->obj_ticket->flage && $this->obj_ticket_owner->flage){
$this->obj_ticket->commit(TRUE);
$this->obj_ticket_owner->commit(TRUE);
$boardname = get_board_name($this->BoardId);
$robot_msg = "\xF0\x9F\x93\xA2 Your Ticket Has Been Successfuly Refrenced From Portal. \n\x23\xE2\x83\xA3 $this->ticket_id \n\xF0\x9F\x93\x8B Board $boardname";
send_with_telegram($this->UserIdReciver, $robot_msg,$this->UserIdSender);
return array("Success" => "1" , "Message" => "Your Ticket Has Been Successfuly Refrenced." );
}else{
$this->obj_ticket->commit(FALSE);
$this->obj_ticket_owner->commit(FALSE);
return array("Success" => "-1" , "Message" => "Error In Ticket Referrals!" );
}
}
}
public function SaveTicketFromPortalResponse($Token){
}
}
$params=array("uri"=>"http://127.0.0.1/board/my-webservice/portal/server.php");
$server = new SoapServer(NULL,$params);
$server->setClass("server");
$server->handle();
من دارم با SoapServer کار میکنم. endpoint رو ساختم. الان نیاز هست که فایل wsdl رو بسازم تا بتونم کارم رو ادامه بدم.
در واقع از کد زیر میخوام wsdl بسازم ..
کسی میتونه راهنمایی کنه ؟
با تشکر
class server{
private $UserIdSender;
private $UserIdReciver;
private $Title;
private $Body;
private $BoardId;
private $obj_ticket;
private $obj_ticket_owner;
private $ticket_id;
public function __construct() {
date_default_timezone_set("Asia/Tehran");
require_once "../../diba-modules/conf.php";
require_once "../../diba-modules/functions.php";
require_once "../../diba-include/entities/ticket.php";
require_once "../../diba-include/entities/ticket_owner.php";
$this->obj_ticket = new \entities\ticket(TRUE);
$this->obj_ticket_owner = new \entities\ticket_owner(TRUE);
mb_internal_encoding("UTF-8");
}
/*public board = 17*/
public function SaveTicketFromPortal($Token,$NationalCodeSender , $NationalCodeReciver , $Title , $Body = "" , $BoardId = 17 ){
$this->UserIdSender = get_id_from_national_code($NationalCodeSender);
$this->UserIdReciver = get_id_from_national_code($NationalCodeReciver);
$this->Title = trim(filter_var($Title,FILTER_SANITIZE_STRING));
$this->Body = trim(filter_var($Body,FILTER_SANITIZE_STRING));
$this->BoardId = filter_var($BoardId,FILTER_SANITIZE_NUMBER_INT);
if($this->UserIdSender <= 0 ){
return array("Success" => "-1" , "Message" => "Sender NationalCode Not Found !" );
}elseif($this->UserIdReciver <= 0 ){
return array("Success" => "-1" , "Message" => "Reciver NationalCode Not Found !" );
} elseif(mb_strlen($this->Title)>500){
return array("Success" => "-1" , "Message" => "OverFlow in Ticket Title Variable! Type Of Variable Is String(500) " );
}elseif(mb_strlen($this->Body)>3000){
return array("Success" => "-1" , "Message" => "OverFlow in Ticket Body Variable! Type Of Variable Is String(3000) " );
}elseif(!is_numeric($this->BoardId) ){
return array("Success" => "-1" , "Message" => "BoardId Should Be Number!" );
}else{
$this->ticket_id = $this->obj_ticket->save(NULL, $this->Title, $this->Body, $this->UserIdSender , date("Y-m-d H:i:s"), "" , 3 , 0 , $this->BoardId);
$this->obj_ticket_owner->save(NULL, $this->ticket_id, $this->UserIdReciver, date("Y-m-d H:i:s"), 3, 0, 1);
if($this->obj_ticket->flage && $this->obj_ticket_owner->flage){
$this->obj_ticket->commit(TRUE);
$this->obj_ticket_owner->commit(TRUE);
$boardname = get_board_name($this->BoardId);
$robot_msg = "\xF0\x9F\x93\xA2 Your Ticket Has Been Successfuly Refrenced From Portal. \n\x23\xE2\x83\xA3 $this->ticket_id \n\xF0\x9F\x93\x8B Board $boardname";
send_with_telegram($this->UserIdReciver, $robot_msg,$this->UserIdSender);
return array("Success" => "1" , "Message" => "Your Ticket Has Been Successfuly Refrenced." );
}else{
$this->obj_ticket->commit(FALSE);
$this->obj_ticket_owner->commit(FALSE);
return array("Success" => "-1" , "Message" => "Error In Ticket Referrals!" );
}
}
}
public function SaveTicketFromPortalResponse($Token){
}
}
$params=array("uri"=>"http://127.0.0.1/board/my-webservice/portal/server.php");
$server = new SoapServer(NULL,$params);
$server->setClass("server");
$server->handle();