This is default featured post 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

Survey

Selasa, 16 Oktober 2012

Lihat variable mysql

mysqladmin variables -u root -p


Rabu, 26 September 2012

ERROR 1548 (HY000): Cannot load from mysql.proc. The table is probably corrupted

Reminder for me :

Nah itu error di mysql, cara perbaikinya dengan cara :
mysql_upgrade; 
atau
mysql_upgrade -p;

Solved after read article from http://www.robsearles.com/

Jakarta, 26 September 2012

Selasa, 25 September 2012

Disallowed Key Characters pada CodeIgniter

Reminder for me :

Setelah fresh install CodeIgniter ternyata di jalankan di localhost muncul pesan Disallowed Key Characters.

Gimana cara perbaikinya? Langsung hapus cookies web browser, dan cling muncul halaman normal.

Jakarta, 25 September 2012

Senin, 10 September 2012

Belajar SOAP dengan NuSoap

Pengantar Web Service

Web service adalah suatu sistem perangkat lunak yang dirancang untuk mendukung interoperabilitas dan interaksi antar sistem pada suatu jaringan. Web service digunakan sebagai suatu fasilitas yang disediakan oleh suatu web site untuk menyediakan layanan (dalam bentuk informasi) kepada sistem lain, sehingga sistem lain dapat berinteraksi dengan sistem tersebut melalui layanan-layanan (service) yang disediakan oleh suatu sistem yang menyediakan web service. Web service menyimpan data informasi dalam format XML, sehingga data ini dapat diakses oleh sistem lain walaupun berbeda platform, sistem operasi, maupun bahasa compiler.

Web service bertujuan untuk meningkatkan kolaborasi antar pemrogram dan perusahaan, yang memungkinkan sebuah fungsi di dalam Web Service dapat dipinjam oleh aplikasi lain tanpa perlu mengetahui detil pemrograman yang terdapat di dalamnya.

Berikut ini adalah dokumentasi dari latihan web service, script untuk server adalah sebagai berikut (server.php):
 
<?php
 function activation($cardId){
  mysql_connect("localhost","root","asdf");
  mysql_select_db("xl");

  $result = mysql_query("select * from card where id_kartu ='".$cardId."'");
  while ($data = mysql_fetch_array($result)) {

   $update = mysql_query("update card set tgl=now(), status='active', 
    msdn='1234321',sn='2345623' where id_kartu ='".$cardId."'");

   $card = array(
    "id" => $data['id'],
    "id_kartu" => $data['id_kartu'],
    "tgl" => $data['tgl'],
    "status" => $data['status'],
    "msdn" => $data['msdn'],
    "sn" => $data['sn']
   );
  }
  mysql_close();
  return $card;
 }

 require ("../lib/nusoap/nusoap.php");
 $server = new nusoap_server();
 $server->configureWSDL("Activation","urn:activationService");
 $server->wsdl->addComplexType(
  "card",
  "complexType",
  "struct",
  "all",
  "",
  array(
   "id_kartu"=>array("name"=>"id_kartu","type"=>"xsd:string"),
   "tgl"=>array("name"=>"tgl","type"=>"xsd:string"),
   "status"=>array("name"=>"status","type"=>"xsd:string"),
   "msdn"=>array("name"=>"msdn","type"=>"xsd:string"),
   "sn"=>array("name"=>"sn","type"=>"xsd:string")
  )
 );

 $server->register("activation",array("cardId"=>"xsd:string"), array("return"=>"tns:card"),"urn:activationService","urn:activationService#activation");

 $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : "";
 $server->service($HTTP_RAW_POST_DATA);
?>

Berikut ini adalah script untuk test dari sisi client (activation.php)
 
<?php
 require ("../lib/nusoap/nusoap.php");
?>

<html>
 <head>
  <title>Activation Card</title>
 </head>
 <body>
  <form action="<?= $_SERVER['PHP_SELF'] ?>" method = "POST">
   ID Kartu&nbsp;:&nbsp;<input type="text" name="idkartu">&nbsp;
   <input type="submit" name="submit" value="Activate">
  </form>
  <?php
  $url = "http://localhost/xl/app/server.php";

  if($_POST['submit']){
   $client = new nusoap_client($url);
   $result = $client->call("activation",array("cardId"=>$_POST["idkartu"]));
   $err = $client->getError();
   if($err){
    echo $client->getError();
   }
   else{
    if($result!=null){
     echo $result['id_kartu']." Berhasil diaktivasi";
    }
    else{
     echo "Code Not Found!!!";
    }
   }
  }
  ?>
 </body>
</html>
Kode lengkap beserta sql dapat di unduh di sini

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More