-2
我有c#示例如何使用某些web服務。如何將這段代碼放到PHP中?將c#的web服務客戶端轉換爲php
PartnerAPI papi = new PartnerAPI();
ApiReqHeader arh = new ApiReqHeader();
arh.clientId = "99992222";
LoginAuthenticationInfo lai = new LoginAuthenticationInfo();
lai.login = "login";
lai.pwd = "password";
ServiceAccountInfo sai = new ServiceAccountInfo();
sai.Serviceaccount = "1234567890";
GetChildAccountInfoBySearchCriteriaRequest child = new GetChildAccountInfoBySearchCriteriaRequest();
child.serviceAccountInfo = sai; // customerInfo = customer;
child.reqHeader = arh;
child.loginAuthenticationInfo = lai;
GetChildAccountInfoBySearchCriteriaResponse resp = papi.GetChildAccountInfoBySearchCriteria(child);
這是隻有一個文件(僅此代碼,需要得到onlu accpount Informa公司)
我添加CLASSE,但還是不行。有什麼不對這個代碼
$papi = new SoapClient($url,
array(
"trace" => 1, // enable trace to view what is happening
"exceptions" => 0, // disable exceptions
"cache_wsdl" => 0) // disable any caching on the wsdl, encase you alter the wsdl server
);
$arh = new ApiReqHeader();
$arh->client_id = "99992222";
$lai = new LoginAuthenticationInfo();
$lai->login = "login";
$lai->pwd = "password";
$sai = new ServiceAccountInfo();
$sai->Serviceaccount = "1234567890";
$child = new GetChildAccountInfoBySearchCriteriaRequest();
$child->serviceAccountInfo = $sai; // customerInfo = customer;
$child->reqHeader = $arh;
$child->loginAuthenticationInfo = $lai;
$resp = $papi->GetChildAccountInfoBySearchCriteria($child);
echo $resp;
class ApiReqHeader{
public $clientId;
}
這不是「請將我的代碼轉換爲我」網站。顯示你在PHP中寫這個的嘗試,我們可以評論/幫助。但否則這歸結爲「給我codez」 –