About parameter passing by PHP call. NETWebService
function CreditCardChargeAction(){ $ezidebit_client = new \SoapClient("http://ws.cardcall.com.au:8092/CreditCardCharge.svc?WSDL"); $ezidebitRequest = array("biz"=>array("BizID"=>"5","ClientIP"=>"101.178.140.96","HttpReferer"=>"https://www.hellophonecards.com.au/hpchome/recharge.aspx", "BMUserAdminID"=>"1","GMUserAdminID"=>"1","Reason"=>"TPC","CardName" => "1147725","CardNumber" => "4862700011382664","CVV"=>"111", "ExpiryYear" => "16","ExpiryMonth" => "10","Amount" => "10","Currency"=>"AUD", "SerialNo" => "CCAW0101171577","Bonus" => "0")); $soap_result = $ezidebit_client->DoCreditCardCharge($ezidebitRequest);}
$ EzidebitRequestI do not know the corresponding parameter passing format here. NET WebService function is DoCreditCardCharge, and the parameter is bizbasecontract. this bizbasecontract is a base class, and other classes inherit this class. what I need to use is payphonecardbywebsitecontract, so I don't know how to pass the parameter,
However. NET WebService payphonecardbywebsitecontract all of them use public without private or protected. you can select the corresponding class in an API test tool I use, but I don't know, the format of the parameter.
This is its XML form.
Is there a problem with the parameter I passed? is it not written in. Net WebService?
If not, how can I write it? Thank you?
If the call is performed according to the passing parameters in my code, an error will be reported.
Reply to discussion (solution)
It depends on the WSDL to know.
Your url cannot be accessed on the internet. you should post the WSDL document.
Or
Print_r ($ ezidebit_client->__ getFunctions ());
Print_r ($ ezidebit_client->__ getType ());
Result
array (size=1) 0 => string 'DoCreditCardChargeResponse DoCreditCardCharge(DoCreditCardCharge $parameters)' (length=77)string 'struct PayOnlyContract { decimal Amount; string CVV; string CardName; string CardNumber; string Currency; int ExpiryMonth; int ExpiryYear; string Notes; string OrderNumber; int UserDialogSubCategoryID;}' (length=213)string 'struct BizBaseContract { int BMUserAdminID; int BizID; string ClientIP; int GMUserAdminID; string HttpReferer; string Reason;}' (length=133)string 'struct PayPhoneCardByWebsiteContract { decimal Amount; decimal Bonus; string CVV; string CardName; string CardNumber; string Currency; int ExpiryMonth; int ExpiryYear; string SerialNo;}' (length=195)string 'struct OrderPinsContract { decimal Amount; decimal Bonus; int CardProductID; string FaceValue; string MerchUniqRef; string OrderNumber; int Qty;}' (length=153)string 'struct PayFlyerCardContract { decimal Amount; decimal Bonus; string CVV; string CardName; string CardNumber; string CardTypePrefix; string Currency; int ExpiryMonth; int ExpiryYear;}' (length=192)string 'struct PayPhoneCardByStaffContract { decimal Amount; decimal Bonus; string CVV; string CardName; string CardNumber; string Currency; int ExpiryMonth; int ExpiryYear; string SerialNo;}' (length=193)string 'struct PayUserContract { decimal Amount; string CVV; string CardName; string CardNumber; string Currency; int ExpiryMonth; int ExpiryYear; int UserID;}' (length=160)string 'struct PayAgentCCContract { decimal Amount; string CVV; string CardName; string CardNumber; int ChargeID; string Currency; int ExpiryMonth; int ExpiryYear; string Note;}' (length=179)string 'struct PayUserDialogContract { decimal Amount; string CVV; string CardName; string CardNumber; string Currency; int ExpiryMonth; int ExpiryYear; string Notes; int UserDialogID; int UserDialogSubCategoryID;}' (length=217)string 'struct ReturnValContract { string Msg; int Success;}' (length=55)string 'struct DoCreditCardCharge { BizBaseContract biz;}' (length=51)string 'struct DoCreditCardChargeResponse { ReturnValContract DoCreditCardChargeResult;}' (length=82)string 'int char' (length=8)string 'duration duration' (length=17)string 'string guid' (length=11)
DoCreditCardChargeResponse DoCreditCardCharge (DoCreditCardCharge $ parameters)
DoCreditCardCharge only has parameters in the DoCreditCardCharge structure.
Array
(
[Biz] => Array
(
[BizID] => 5
[ClientIP] => 101.178.140.96
[HttpReferer] => https://www.hellophonecards.com.au/hpchome/recharge.aspx
[BMUserAdminID] => 1
[GMUserAdminID] => 1
[Reason] => TPC
[CardName] = & gt; 1147725
[CardNumber] => 4862700011382664
[CVV] = & gt; 111
[ExpiryYear] => 16
[ExpiryMonth] => 10
[Amount] => 10
[Currency] => AUD
[SerialNo] => CCAW0101171577
[Bonus] => 0
)
)
Why do you have more parameters? And the order is incorrect. Note:. Net has strict parameter requirements.
Is the printing result of print_r much clearer than that of var_dump?
$ezidebitRequest = array("biz"=>array( "BizID"=>"5","ClientIP"=>"101.178.140.96", "BMUserAdminID"=>"1","GMUserAdminID"=>"1","HttpReferer"=>"https://www.hellophonecards.com.au/hpchome/recharge.aspx","Reason"=>"TPC", "CardName" => "1147725","CardNumber" => "4862700011382664","CVV"=>"111","ExpiryYear" => "16","ExpiryMonth" => "10", "Amount" => "10","Currency"=>"AUD", "SerialNo" => "CCAW0101171577","Bonus" => "0"));
I have tried writing in the sequence of continued writing, but he will report such an error.
Data contract and biz ID doesn't match
Data contract and business ID do not match
So, this is, my problem, or the. net issue. if it's a. net issue, what should I ask him to do?
Data contract and biz ID doesn't match
Data contract and business ID do not match
PayPhoneCardByWebsiteContract is an inherited class of BizBaseContract.
Therefore, the PayPhoneCardByWebsiteContract type can be directly transferred as a parameter. bizid = 5 is automatically parsed to find the corresponding contract type.
This means that if bizid = 5 is found, it is initialized to PayPhoneCardByWebsiteContract.
So the error of id doesn' t match is very strange.
So, it's strange why the PayPhoneCardByWebsiteContract method is not specified.
Data contract and biz ID doesn't match
Data contract and business ID do not match
Okay, let. net re-write a method. add the PayPhoneCardByWebsiteContract method directly in BizBaseContract, so that he will not inherit it.