dongyu7074 2016-11-14 10:12
浏览 46

使用PHP的TecDoc webservice

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 !!

  • 写回答

1条回答 默认 最新

  • drurhg37071 2017-01-24 12:40
    关注

    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.

    评论

报告相同问题?

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效