[英]PHP Soap Call and Response
我正在打肥皂:
$client = new SoapClient('http://test.com/collect/test.wsdl');
然后我用:
var_dump($client->__getTypes());
这将返回以下内容:
2array(43) {
[0]=>
string(52) "struct ProcessBrokerLead {
BrokerRequest request;
}"
[1]=>
string(77) "struct ProcessBrokerLeadResponse {
BrokerResponse ProcessBrokerLeadResult;
}"
[2]=>
string(8) "int char"
[3]=>
string(17) "duration duration"
[4]=>
string(11) "string guid"
[5]=>
string(118) "struct BrokerRequest {
ExternalReference ExternalReference;
LoanRequest LoanRequest;
ArrayOfApplicant Applicants;
}"
[6]=>
string(249) "struct ExternalReference {
string IntroducerReference;
string SubAffiliate;
string Campaign;
string ApplicationReference;
boolean IsSpeculative;
boolean IsInteractive;
boolean HasConsentedToCreditSearch;
boolean HasConsentedForDataSharing;
}"
[7]=>
string(211) "struct LoanRequest {
decimal LoanAmount;
int LoanTerm;
InstalmentType PaymentFrequency;
boolean IsSecured;
Purpose Purpose;
ArrayOfSecurity Securities;
DayOfWeek RepaymentDay;
decimal InstalmentAmount;
我如何访问此数据
我努力了
$res = $client->ProcessBrokerLead();
print_r($res);
我只是继续得到错误,我对SOAP很新,我真的可以使用一些帮助
从该输出中获取的ProcessBrokerLead是数据类型,而不是方法调用或操作。
要找出可以执行的操作,您可以使用:
var_dump($client->__getFunctions());
输出将告诉您响应数据类型以及每个操作需要使用的参数数据类型。
然后你使用var_dump($client->__getTypes());
获取有关每种数据类型的详细信息。
将struct
视为与class
相同的东西是有帮助的。 例如,您有这个名为ProcessBrokerLead
数据结构(类),并且该结构内部是一个名为request
的属性。 request
本身是另一个名为BrokerRequest
数据结构。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.