About PHP calling. NET WebService parameter issues

Source: Internet
Author: User
Tags wsdl
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" and "=" Https://www.hellophonecards.com.au/hpchome/recharge.aspx ",               " Bmuseradminid "=" 1 "," Gmuseradminid "and" 1 " , "Reason" = "TPC", "Cardname" and "1147725", "Cardnumber" and "4862700011382664", "CVV" and "111",               " Expiryyear "+", "Expirymonth" and "Ten", "Amount" and "Ten", "Currency" and "AUD", "Serialno" and "=" CCAW0101171577 "," Bonus "=" 0 "));   $soap _result = $ezidebit _client->docreditcardcharge ($ezidebitRequest);}

$ezidebitRequestThe corresponding parameter format is not known here, the. NET WebService function I called is docreditcardcharge, and the argument is Bizbasecontract, and this bizbasecontract is a base class, Other classes inherit this class, and I need to use the Payphonecardbywebsitecontract class, so I don't know how to pass the argument.
and. NET WebService payphonecardbywebsitecontract This, all use public no private or protected, I use an API test tool can choose corresponding class, but I do not know, What format to pass, such a parameter.



This is its XML form



Is there a problem with my pass-through parameters or is it not well written by. Net WebService?
How do you write if you don't write well? Thank you?

If you follow the instructions in my Code, he will report a mistake.


Reply to discussion (solution)

It depends on the WSDL.
Your URL is not accessible on the public network, you should post the WSDL document
Or
Print_r ($ezidebit _client->__getfunctions ());
Print_r ($ezidebit _client->__gettype ());
The results

Array (size=1) 0 = String ' docreditcardchargeresponse docreditcardcharge (docreditcardcharge $parameters) ' (length= String ' struct payonlycontract {decimal Amount; string CVV; string cardname; string cardnumber; string Currency; int E Xpirymonth; int expiryyear; String Notes; String OrderNumber; int Userdialogsubcategoryid;} ' (length=213) string ' struct bizbasecontract {int bmuseradminid; int bizid; string clientip; int Gmuseradminid; string Http Referer; string Reason;} ' (length=133) string ' struct payphonecardbywebsitecontract {decimal Amount; decimal Bonus; string CVV; string cardname; str ing 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 Cardn umber; String CardtypePrefix; String Currency; int expirymonth; int expiryyear;} ' (length=192) string ' struct payphonecardbystaffcontract {decimal Amount; decimal Bonus; string CVV; string cardname; Strin G Cardnumber; String Currency; int expirymonth; int expiryyear; string Serialno;} ' (length=193) string ' struct payusercontract {decimal Amount; string CVV; string cardname; string Cardnumber; string Curren Cy int expirymonth; int expiryyear; int UserID;} ' (length=160) string ' struct payagentcccontract {decimal Amount; string CVV; string cardname; string cardnumber; int Charge ID; 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 the parameters of 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] = 1147725
[Cardnumber] = 4862700011382664
[CVV] = 111
[Expiryyear] = 16
[Expirymonth] = 10
[Amount] = 10
[Currency] = AUD
[Serialno] = CCAW0101171577
[Bonus] = 0
)
)

Why do you have more parameters? And the order is wrong. It is important to know that the. Net parameter requirements are strict

Is the result of Print_r printing a lot more refreshing than var_dump printing?

$ezidebitRequest = Array ("Biz" =>array ("            bizid" = "5", "clientip" = "101.178.140.96", "bmuseradminid" = > "1", "gmuseradminid" = "1", "Httpreferer" and "https://www.hellophonecards.com.au/hpchome/recharge.aspx", " Reason "=" TPC ",            " Cardname "and" 1147725 "," Cardnumber "and" 4862700011382664 "," CVV "and" 111 "," Expiryyear "+", "Expirymonth" and "Ten",            "Amount" and "Ten", "Currency" and "AUD", "Serialno" and "=" CCAW0101171577 "," Bonus "=" 0 "));

Write in the order of continuation, I tried, but he would have reported such a mistake.

Data Contract and Biz ID doesn ' t match
Data contract and Business ID mismatch

So, this is, my question, or the. NET side of the problem, if it is. NET over there, what should I let him do

Data Contract and Biz ID doesn ' t match
Data contract and Business ID mismatch


Payphonecardbywebsitecontract is the inheriting class of Bizbasecontract
So the parameters can be transmitted directly payphonecardbywebsitecontract this type, bizid=5 automatically resolve to find the corresponding contract type
It means discovering bizid=5, then initializing it to the payphonecardbywebsitecontract type.
So ID doesn ' t match the error, very strange.
So, it's strange why, without specifying Payphonecardbywebsitecontract, this method

Data Contract and Biz ID doesn ' t match
Data contract and Business ID mismatch


Well, let. NET have a way to re-write a method here, add payphonecardbywebsitecontract this method directly in the Bizbasecontract, do not let him inherit
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.