php - AddressDoctor WSDL和 PHP

  显示原文与译文双语对照的内容

我正在尝试从 php http://validator2.addressdoctor.com/addBatch/Batch.asmx?wsdl 调用 WSDL 。


define('ADDRESSDOCTOR_WSDL_URL','http://validator2.addressdoctor.com/addBatch/Batch.asmx?wsdl');
define('ADDRESSDOCTOR_USER_LOGIN','myaccount');
define('ADDRESSDOCTOR_USER_PASSWORD','password');

$useinfo = array(
"CustomerID"=>ADDRESSDOCTOR_USER_LOGIN,
"DepartmentID"=>0,
"Password"=>ADDRESSDOCTOR_USER_PASSWORD
);

$addressinfo = array(
"Street"=>"main st",
"Locality"=>"wayne",
"PostalCode"=>"07035",
"Province"=>"NJ",
"Country"=>"USA");

$addressinfo1 = array(
"Street"=>"100 newark tpk",
"Locality"=>"wayne",
"PostalCode"=>"07470",
"Province"=>"NJ",
"Country"=>"USA");

$array_of_add = array("Address"=>$addressinfo,"Address"=>$addressinfo1);

$client = new SoapClient(ADDRESSDOCTOR_WSDL_UR);
$function = $client->Validate(array("addBatchRequest"=>array("Authentication"=>$useinfo,"Parameters"=>$paramenters,**"AddressCount"=>2**,"Addresses"=>$array_of_add)));

$result = $function->ValidateResult;

print_r($result);

它给我的错误与提供地址的数量不匹配。

如果我写


$function = $client->Validate(array("addBatchRequest"=>array("Authentication"=>$useinfo,"Parameters"=>$paramenters,"AddressCount"=>1,"Addresses"=>$array_of_add)));

"AddressCount"changed changed changed changed"AddressCount"works works works works works works works works works works works works works works works 我可以在每个批次请求中达到 10个数。 但我无法得到它。 请帮我一个忙,我在做什么。

时间: 作者:

我想出来了我得把


$array_of_add = array($addressinfo,$addressinfo1);

代替


$array_of_add = array("Address"=>$addressinfo,"Address"=>$addressinfo1);

作者:
...