Welcome Guest, Not a member yet? Register   Sign In
SOAP - Java WebService
#1

[eluser]ibnclaudius[/eluser]
I have this code to call a Java Web Service, everything work correctly, but I`d like to know if you guys recommend me change something...

Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class test_library
{
var $CI;
var $test = array();

public function __construct()
{
  $this->CI =& get_instance();

  $this->CI->load->config('test_config', TRUE);
  $this->test['config'] = $this->CI->config->item('test', 'test_config');

  try
  {
   $this->test['client'] = new SoapClient($this->test['config']['client']['wsdl'], $this->test['config']['client']['options']);
  }
  catch (Exception $e)
  {
   log_message('error', $e->getMessage());
   $this->test['client'] = NULL;
  }
}

public function say_hello($name)
{
  if ($this->test['client'])
  {
   try
   {
    $params = array('arg0' => $name);
    $response = $this->test['client']->sayHello($params)->return;
   }
   catch (Exception $e)
   {
    log_message('error', $e->getMessage());
    $response = NULL;
   }
  }
  else
  {
   $response = NULL;
  }

  return $response;
}
}
#2

[eluser]CroNiX[/eluser]
Why are you using php4 style property declarations?
#3

[eluser]ibnclaudius[/eluser]
You mean the "var"? I don`t know hahaha Changed!




Theme © iAndrew 2016 - Forum software by © MyBB