nagios
+ Reply to Thread
Results 1 to 1 of 1

Thread: PHP examples

  1. #1
    Join Date
    Jun 2009
    Posts
    10

    PHP examples

    These are working for me, feel free to use them at your own risk

    class MSSoapClient extends SoapClient {
    private $namespace;
    function __doRequest($request, $location, $action, $version) {


    $request = preg_replace('/<ns*\w+)/', '<$* xmlns="'.$this->namespace.'"', $request, *);
    $request = preg_replace('/<ns*\w+)/', '<$*', $request);
    $request = str_replace(array('/ns*:', 'xmlns:ns*="'.$this->namespace.'"'), array('/', ''), $request);

    // parent call
    return parent::__doRequest($request, $location, $action, $version);
    }
    function setNamespace($sNamespace)
    {
    $this->namespace=$sNamespace;
    }

    }

    To make a new ******** - I'm only you can extend the function to add other details to the record.

    function newKashflow********($soapClient,$idAccount,$name,$address,$town,$postcode,$country,$email)
    {
    //returns ******** id if ok else 0

    $today = date("Y-m-d",mktime());

    $********Array = array(
    "********ID"=>"",
    "Code"=>"",
    "Name"=>"$name",
    "Contact"=>"",
    "Telephone"=>"",
    "Mobile"=>"",
    "Fax"=>"",
    "Email"=>"$email",
    "Address*"=>"$address",
    "Address2"=>"",
    "Address*"=>"$town",
    "Address4"=>"$country",
    "Postcode"=>"$postcode",
    "Website"=>"",
    "EC"=>"0",
    "Notes"=>"",
    "Source"=>"",
    "Discount"=>"0",
    "ShowDiscount"=>"0",
    "PaymentTerms"=>"0",
    "ExtraText*"=>"*",
    "ExtraText2"=>"*",
    "CheckBox*"=>"*",
    "CheckBox2"=>"*",
    "Created"=>"$today",
    "Updated"=>"$today");

    $args = array ("UserName"=>"your username here", "Password"=>"your password here","custr"=>$********Array);
    $oResponse = $soapClient->Insert********($args);
    //handle any errors
    if($oResponse->Status != "OK")
    {
    echo $oResponse->StatusDetail;
    $return = 0;

    }
    else
    {
    $id = $oResponse->Insert********Result;

    $return = $id;

    }
    return $return;
    }
    Last edited by gordo; 08-06-2009 at 07:24 AM.

+ Reply to Thread

Similar Threads

  1. Java Injection Examples
    By Nexus_Logik in forum Tutorials
    Replies: 1
    Last Post: 01-04-2008, 01:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts