SlimenTN
SlimenTN

Reputation: 3564

TecDoc webservice with PHP

I want to use TecDoc webservice in my php application can anyone give me a good documentation about it, I was searching alot but I still can't find a good and clear one.

Thanks in advance.

UPDATE:
I found this code under this link and this site that helps you test the functions provided by the TecDoc webservice.
So I tried the getMarkById function and it worked fine (on the site), then I tried it in my php application this way (with the same parameters):

ini_set('memory_limit','512M');
ini_set('display_errors', true);
error_reporting(-1);
/**
 * Load autoload
 */
require_once dirname(__FILE__) . '/TecDocAutoload.php';
/**
 * TecDoc Informations
 */
define('TECDOC_WSDL_URL','http://webservicepilot.tecdoc.net/pegasus-2-0/wsdl/TecdocToCat');
define('TECDOC_USER_LOGIN','');
define('TECDOC_USER_PASSWORD','');
/**
 * Wsdl instanciation infos
 */
$wsdl = array();
$wsdl[TecDocWsdlClass::WSDL_URL] = TECDOC_WSDL_URL;
$wsdl[TecDocWsdlClass::WSDL_CACHE_WSDL] = WSDL_CACHE_NONE;
$wsdl[TecDocWsdlClass::WSDL_TRACE] = true;
if(TECDOC_USER_LOGIN !== '')
    $wsdl[TecDocWsdlClass::WSDL_LOGIN] = TECDOC_USER_LOGIN;
if(TECDOC_USER_PASSWORD !== '')
    $wsdl[TecDocWsdlClass::WSDL_PASSWD] = TECDOC_USER_PASSWORD;
// etc....
/**
 * Examples
 */


/******************************
 * Example for TecDocServiceGet
 */
$tecDocServiceGet = new TecDocServiceGet($wsdl);

if($tecDocServiceGet->getMarkById(new TecDocStructMarkByIdRequest(
    'de',
    'de',
    true,
    10,
    20276
)))
    var_dump($tecDocServiceGet->getResult()->data);
else
    print_r($tecDocServiceGet->getLastError());

But I get this result:

object(TecDocStructMarkByIdResponse)[5]
  public 'data' => null
  public 'status' => int 401
  public 'statusText' => string 'Access not allowed' (length=18)
  private 'result' (TecDocWsdlClass) => null
  private 'lastError' (TecDocWsdlClass) => null
  private 'internArrayToIterate' (TecDocWsdlClass) => null
  private 'internArrayToIterateIsArray' (TecDocWsdlClass) => null
  private 'internArrayToIterateOffset' (TecDocWsdlClass) => null

I don't know why I'm not allowed to access this function !!

Upvotes: 0

Views: 2788

Answers (1)

javiernr1024
javiernr1024

Reputation: 11

1.4 Access Control In each request function there is a parameter provider of type integer. TecDoc assigns this number to each mandator. It is evaluated to authenticate the mandator and authorize the request together with the ip address of the request. The static ip address or addresses of the mandator are configured by TecDoc based on the information provided by the mandator. The webservice "addDynamicAddress()" can be used. It is the first webservice described within this document.

As it's been said in the documentation, you need this Provider Id in order to read data.

Upvotes: 1

Related Questions