PHP 肥皂调用和响应
PHP Soap Call and Response
我正在打肥皂电话:
$client = new SoapClient('http://test.com/collect/test.wsdl');
然后我使用:
var_dump($client->__getTypes());
这个 returns 以下 :
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
的数据结构 (class),并且在该结构内部有一个名为 request
的 属性。 request
本身就是另一种数据结构,叫做 BrokerRequest
.
我正在打肥皂电话:
$client = new SoapClient('http://test.com/collect/test.wsdl');
然后我使用:
var_dump($client->__getTypes());
这个 returns 以下 :
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
的数据结构 (class),并且在该结构内部有一个名为 request
的 属性。 request
本身就是另一种数据结构,叫做 BrokerRequest
.