欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

求前辈支援,连接wsdl问题。

程序员文章站 2022-05-19 10:18:18
...
echo '提供的方法';dump($client->__getFunctions());echo '数据结构';dump($client->__getTypes());

页面打印:
提供的方法
array(1) {
[0] => string(56) "AdcServicesResponse AdcServices(AdcServices $parameters)"
}
数据结构
array(4) {
[0] => string(37) "struct AdcServices {
NGEC request;
}"
[1] => string(217) "struct NGEC {
string OrigDomain;
string BIPCode;
string BIPVer;
string TransIDO;
string Areacode;
string ECCode;
string ECUserName;
string ECUserPwd;
string ProcessTime;
Response Response;
string SvcCont;
}"
[2] => string(53) "struct Response {
string RspCode;
string RspDesc;
}"
[3] => string(55) "struct AdcServicesResponse {
NGEC AdcServicesResult;
}"
}

我现在往 $client->ADCServices()里怎么传参呢?
第一回接触这种,整个人都是晕的。


回复讨论(解决方案)

AdcServicesResponse AdcServices( AdcServices $parameters)
表示 AdcServices 需要一个 AdcServices 类型的参数

struct AdcServices {
NGEC request;
}
表是 AdcServices 有一个 NGEC 类型的参数 request
找到 NGEC 并带入,得
AdcServices {
NGEC request = {
string OrigDomain;
string BIPCode;
string BIPVer;
string TransIDO;
string Areacode;
string ECCode;
string ECUserName;
string ECUserPwd;
string ProcessTime;
Response Response = {
string RspCode;
string RspDesc;
},
string SvcCont;
}
}
由于 php 并无 struct 结构,所以用关联数组代替

$ar = array(   'request'  => array(      'OrigDomain' => '',      'BIPCode' => '',      'BIPVer' => '',      'TransIDO' => '',      'Areacode' => '',      'ECCode' => '',      'ECUserName' => '',      'ECUserPwd' => '',      'ProcessTime' => '',      'Response' => array(         'RspCode' => '',         'RspDesc' => '',      ),      'SvcCont' => '',  ));
调用时
$client->AdcServices($ar)

AdcServicesResponse AdcServices( AdcServices $parameters)
表示 AdcServices 需要一个 AdcServices 类型的参数

struct AdcServices {
NGEC request;
}
表是 AdcServices 有一个 NGEC 类型的参数 request
找到 NGEC 并带入,得
AdcServices {
NGEC request = {
string OrigDomain;
string BIPCode;
string BIPVer;
string TransIDO;
string Areacode;
string ECCode;
string ECUserName;
string ECUserPwd;
string ProcessTime;
Response Response = {
string RspCode;
string RspDesc;
},
string SvcCont;
}
}
由于 php 并无 struct 结构,所以用关联数组代替

$ar = array(   'request'  => array(      'OrigDomain' => '',      'BIPCode' => '',      'BIPVer' => '',      'TransIDO' => '',      'Areacode' => '',      'ECCode' => '',      'ECUserName' => '',      'ECUserPwd' => '',      'ProcessTime' => '',      'Response' => array(         'RspCode' => '',         'RspDesc' => '',      ),      'SvcCont' => '',  ));
调用时
$client->AdcServices($ar)

前辈我爱你~~~