Worldspan GDS

Guys after a long long period of time and after finishing my college life i think its the time i should share my experience and knowledge with ya, I have gone through some very intelligent systems such as GDS and currently working in the travel industry with a designation of web services programmer feel free to look at my company website and have a look at my booking engine which i have developed My Booking Engine.

Well any one having a relatively small experience in browsing websites must have already understood that the site runs on PHP yes the Personal Hypertext Processor . a pretty small language with a very small library but a wide variety of support and as always open source
take some time out of your schedule to look up the PHP website.

I am working with the webservices exposed by the travelport worldspan GDS , the worldspan is the Global Distribution System which offers the Flight information and Booking API my current employer has paid a hefty sum of $'s to Travelport to gain access to their API and i am here by telling you guys some of the tweaks to get the most optimum result from the travelport WORLDSPAN
 The Technology used by my current Employer is PHP a typical scripting language which is evolving day by day into a hardcore OOL . As a Java Developer it was really difficult for me to get into the scripting methodology so i changed it i have used typical Java Methodology of creating classes and objects for getting into the Java flavour and i was successful also, already two versions of the system are live and running over the web.
for connecting to the worldspan GDS system one requires a SOAP call for calling the the worldspan web service a SORRY for the upcoming developers that currently WORLDSPAN GDS DO NOT SUPPORT WSDL hence we have to call each operation manually.
        For the purpose of authentication the GDS API uses a tc file or a transaction control header
an example of the XML TC file is as follows:


Transaction Control Data
The transaction control data (TC) XML is part of each transaction and allows you to control the underlying provider the message is to be routed to. It is also used for user authentication on transaction level. A TC must be sent with every Xml Pro request message.
Request TC
<tc>
    <iden p="" u="">
    <provider session="" pcc=" >WORLDSPAN</provider>
    <trace></trace>
</iden><tc>





Node
Description
Default (if not specified)
iden
Client identity information for transaction authentication on Xml Pro Server.Attributes:
u = user id
p = password

 mandatory
provider
Name of the provider route. Worldspan will provide this setting.Attributes:
session = identifies session pool or data source of provider
pcc = emulation SID, Mandatory for share environment user

mandatory
trace
Free use trace id for traces to be captured with XXTrace utility
optional



Well dont worry about the technical details its just basic authentication header which could be passed over the normal HTTP or OVER SSL (HTTPS) if your company requires you to do so
let me show you a snippet of the code calling the webservice in php to give you a better understanding of how the things work
Please Be patient and look more towards the highlighted part of the code



require_once("nusoap.php"); //NuSoap library for SOAP access
require_once("class.db_handler.php");

  class request_builder
  {
      var $num_adt;
      var $num_chd;
      var $num_inf;
      var $cab_cla;
      var $origin_code;
      var $dest_code;
      var $search_type;
      var $dep_date;
      var $ret_date;
      var $req_fet;
      var $request_id;
      var $xml_request;
      var $req;
      var $params;
      var $header;
      var $operation;
      var $namespace;
  function request_builder($adt,$chd,$inf,$cabin,$ori,$dest,$srt,$depdate,$retdate,$request_id){
        $this->num_adt=$adt;
        $this->num_chd=$chd;
        $this->num_inf=$inf;
        $this->cab_cla=$cabin;
        $this->origin_code=$ori;
        $this->dest_code=$dest;
        $this->dep_date=$depdate;
        $this->ret_date=$retdate;
        $this->search_type=$srt;
        $this->namespace="xxs";
        $this->header;
        $this->operation="216.113.130.252:8800";
        $this->request_id=$request_id;
      
        $dbhan= new db_handler();
      
        $this->req=$dbhan->get_request($request_id);
        $this->build_request($this->req);
      
      }
  private function build_request($arr){
      //print_r($arr);
         $str="";
          $opt_arr=explode(",",$arr->options);
          $str.="OH";
          foreach($opt_arr as $opt){
          $str.="$opt";
          }
        
          $str.="$this->origin_code12";
          $str.="".$arr->num_alt."";
          $inc_arl_arr=explode(",",$arr->inc_arl);
          $exc_arl_arr=explode(",",$arr->exc_arl);
          if((count($inc_arl_arr)>=1||count($exc_arl_arr)>=1)&&($arr->inc_arl!=''||$arr->exc_arl!=''))
          {
              $str.="";
              if(count($exc_arl_arr)>0&&$arr->exc_arl!='')
              {
                  $str.="";
                  foreach($exc_arl_arr as $exc)
                  {
                      $str.="".$exc."";
                  }
                  $str.="";
              }
              if(count($inc_arl_arr)>0&&$arr->inc_arl!='')
              {
                  $str.="".$arr->arl_opt."";
                  foreach($inc_arl_arr as $inc)
                  {
                      $str.="".$inc."";
                  }
                
              }
            $str.="";
          }
            $rdate=$this->ret_date;
             $ddate=$this->dep_date;
        
        $ptc_arr=explode(",",$arr->ptc);
        $ptc = "$this->num_adt$ptc_arr[0]";
        if($this->num_chd>0){
        $ptc .= "$this->num_chd$ptc_arr[1]";
        }
        if($this->num_inf>0){
        $ptc .= "$this->num_inf$ptc_arr[2]";
        }
        $str.=$ptc;
        $str.="$ddate1200E$this->dest_code";
        if($this->search_type=="RT")
          {
           $str.="$rdate1200E$this->origin_code";
          }
        $str.="";
        $this->header="Worldspan";
       $this->params=$str;
       //echo $str;
      
      }
  private function normalize_date($date) {
        $date = explode('/', $date);
        $date_mon = $date[0];
        $date_dat = $date[1];
        $date_yea = $date[2];
        switch ($date_mon) {
            case 1:
                $date_mon = "JAN";
                break;
            case 2:
                $date_mon = "FEB";
                break;
            case 3:
                $date_mon = "MAR";
                break;
            case 4:
                $date_mon = "APR";
                break;
            case 5:
                $date_mon = "MAY";
                break;
            case 6:
                $date_mon = "JUN";
                break;
            case 7:
                $date_mon = "JUL";
                break;
            case 8:
                $date_mon = "AUG";
                break;
            case 9:
                $date_mon = "SEP";
                break;
            case 10:
                $date_mon = "OCT";
                break;
            case 11:
                $date_mon = "NOV";
                break;
            case 12:
                $date_mon = "DEC";
                break;
        }
        $date = $date_dat.$date_mon;
        return $date;
    }
  public function execute_request()  
    {
       // echo htmlspecialchars($this->params);
      $client= new nusoap_client("https://xmlpro.worldspan.com:443");//instance of a nusoap_client
      if($client->fault)// Check for errors
      { 
          echo $client->faultstring;
      }
      $client->timeout=5000;
      $client->response_timeout=5000;
      $result = $client->call($this->operation, $this->params, $this->namespace, null, $this->header, null, null, null);
      return $client->responseData;// We have just called the Service of the worldspan
    
    }
  }

For Complete code listing archive please check out the Google SVN for cheapfareguru.com


VBA reading from a text file

The code for reading from a text file looks like this:

Sub readtxtfile()

Defining constants
Const ForReading = 1, ForWriting = 2, ForAppending = 3

  Dim fs, f

Clear the sheet where results will be written. 65536 is the maximum line number before excel 2007. 

  Sheets("sheets 1").Rows("2:65536").Delete
 
  Set fs = CreateObject("Scripting.FileSystemObject")

  Set f = fs.OpenTextFile("file.txt", ForReading, TristateFalse)

Reading line by line until end of file.
  i = 2
  While f.AtEndOfStream <> True
      txt = Trim(f.readline)
      Sheets("sheets 1").Cells(i, 1) = txt
      i = i + 1
  Wend

End Sub

Enjoy.


SOAP and PHP

Calling a SOAP based service could not be this easy as it can be done with PHP


$objClient = new SoapClient("http://foobar.in/services/blahblah?wsdl", array('trace' => true));

$objResponse = $objClient->getGreeting(array("name" => "tom"));

//print($objClient->__getLastRequest());
print_r($objResponse);

$objResponse
stdClass Object
(
[out] => stdClass Object
(
[message] => Hello tom!
)
)

Constants in PHP

A constant is an identifier (name) for a simple value. As the name suggests, that value cannot change during the execution of the script (except for magic constants, which aren't actually constants). A constant is case-sensitive by default. By convention, constant identifiers are always uppercase.
The name of a constant follows the same rules as any label in PHP. A valid constant name starts with a letter or underscore, followed by any number of letters, numbers, or underscores. As a regular expression, it would be expressed thusly: [a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*

Example: Valid and invalid constant names

<?php
// Valid constant names
define("FOO", "something");
define("FOO2", "something else");
define("FOO_BAR", "something more");

// Invalid constant names
define("2FOO", "something");

// This is valid, but should be avoided:
// PHP may one day provide a magical constant
// that will break your script
define("__FOO__", "something");

?>

Note: For our purposes here, a letter is a-z, A-Z, and the ASCII characters from 127 through 255 (0x7f-0xff).

Like superglobals, the scope of a constant is global. You can access constants anywhere in your script without regard to scope.

Syntax

You can define a constant by using the define()-function. Once a constant is defined, it can never be changed or undefined.
Only scalar data (boolean, integer, float and string) can be contained in constants. Do not define resource constants.
You can get the value of a constant by simply specifying its name. Unlike with variables, you should not prepend a constant with a $. You can also use the function constant() to read a constant's value if you wish to obtain the constant's name dynamically. Use get_defined_constants() to get a list of all defined constants.
Note: Constants and (global) variables are in a different namespace. This implies that for example TRUE and $TRUE are generally different.
If you use an undefined constant, PHP assumes that you mean the name of the constant itself, just as if you called it as a string (CONSTANT vs "CONSTANT"). An error of level E_NOTICE will be issued when this happens. If you simply want to check if a constant is set, use the defined() function.

These are the differences between constants and variables:
• Constants do not have a dollar sign ($) before them;
• Constants may only be defined using the define() function, not by simple assignment;
• Constants may be defined and accessed anywhere without regard to variable scoping rules;
• Constants may not be redefined or undefined once they have been set; and
• Constants may only evaluate to scalar values.

Example: Defining Constants

<?php
define("CONSTANT", "Hello world.");
echo CONSTANT; // outputs "Hello world."
echo Constant; // outputs "Constant" and issues a notice.
?>

ListAppend

ListAppend is a rather simple utility function, however when you are dealing with lists, it can prove a great ally. This is a function that I pulled out of a class of list functions. I will publish the entire class once I get the individual functions published. The default delimiter for the ListAppend function is a ','. The delimiter length should be 1 character. Regardless of the size of the delimiter, the function will only use the first character.

The Function:

<php

function ListAppend($list,$value,$delimiter= ",")
{
$delimiter = substr($delimiter,1);
$nList = $list . $delimiter . $value;
return $nList;
}

?>

Usage:
StatementOutputComment
ListAppend('elem1,elem2', '' )elem1,elem2,Appended element is empty; delimiter is last character in list; list length is 2.
ListAppend('', 'elem1,elem2' )elem1,elem2List length is 2.
ListAppend("one___two", "three", "___")"one___two_three"Inserted the first character of delimiters before "three."

ListAppend works great to add values to a list. This function will default to a ',' for a delimiter!

For Example:

<?php
$list = "abcd";
$value = "Z";
echo ListAppend($list,$value);
?>


The results is 'abcd,Z'!

By sending the correct delimiter through, in this case '':

<?php
$list = "abcd";
$value = "Z" ;
echo ListAppend($list,$value,"");
?>


The results is 'abcdZ'!

Simple File Upload

The standard username and password are: file and password.

You can edit this by opening the index.php file.



The stylesheet you can, if you want so, edit this to your own wishes.

Standard you will see two file inputs. You can change this be settings
the $files_to_upload to another value.
Download Link:

http://lonsmall.summerhost.info/download.php?file=215simple_fileupload1_13.zip

Credit Repair - It's All About Saving Money

crack hotmail password, cannot fault this service from http://www.activehacker.org/how-to-hack-hotmail-password.php! Supports all I need and request was quick and easy. Even though hack facebook passwords service checks each application, it makes me feel secure hack sbcglobal email the service is top quality. The best thing however is the feedback/help service. Any help or request is dealt with and usually delivered in cracking time! Great job, no need to look anywhere else! Oh, and a whopping $100.00 ! which is usually more than hack into facebook profiles to know crack hotmail password! ActiveHackers.com is excellent. the support is amazing, I'm Free Download Ihacking V21 Hack Facebook Hacking Yahoo Crack Hotmail Cracking Gmail because How To Hack Yahoo Password group doesn't even offer this ammount of support. I found these people reliable, efficient and not too expensive. Thanks http://www.activehacker.org/how-to-hack-hotmail-password.php.

BTW, I found another website that can hack into someones yahoo passwords and other one specialized in hack hotmail passwords.

Michael Bellamy, Lincoln

England

Why is credit Activehacker important? It comes down to one simple thing - saving money.

Everyone has a credit report. It turns out that about 70% of all credit reports contain inaccurate or untimely information. This can have an adverse effect on your credit score and that can cost you money. Credit repair is the process you undertake to remove or correct these errors on your credit report.

The great thing about repairing your credit is it's not difficult to do. The first step is to how to hack facebook a copy of your credit report. If you have been turned down for a loan or credit, you are entitled to a free credit report within 60 days of the rejection. You are also entitled to 1 free report from each of the 3 credit reporting agencies each year.

The next step is to let the credit reporting agency know in writing what information you think is inaccurate and request that it be removed or corrected. Make sure you send the letter by certified crack facebook account so you have a receipt with a record of when you sent it. Always keep copies of your letters.

The credit reporting agencies have 30 days to investigate your dispute and get back to you. If they find the information under dispute to be inaccurate, they must notify all three credit reporting agencies and the creditor or organization that provided the information. All of them must correct the information in your file.

When the investigation is complete, the credit reporting agency will provide you with the results and a copy of your updated credit report for your review.

If the investigation does not resolve the issue, you can request to have a statement of the dispute added to your file and on future credit reports.

Then you need to send a letter to the creditor or organization that provided the inaccurate information, telling them that you dispute their information. Include all documents that support your position. If the creditor reports the information to a credit reporting agency, it must also include a notice of the dispute.

So why go through this exercise? Your credit score determines how much interest you pay on loans or credit. If you add up how much interest you pay on your car loan, home mortgage and insurance, you can see just how much money is at stake - it can be thousands, tens of thousands or even hundreds of thousands of dollars. It can even determine if you get a job or not.

Credit repair is how to hack into facebook account in making sure your credit report is accurate so you can save money - sometimes a great deal of money.
Thomas Erikson is co-founder of http://www.your-debt-consolidation-loan.com which provides http://www.your-debt-consolidation-loan.com/credit-repair.html information and solutions.