php将可变量的肥皂参数传递给肥皂客户端

时间:2014-01-31 17:13:03

标签: php web-services soap

我有一个php soap客户端,可以生成xml信封和请求。我需要向请求传递可变数量的节点。由于我不知道将传递多少参数,因此它需要是动态的。

$output = $this->_client->UpdateRequest(
            new SoapParam($this->_memberId, "MemberID"),
            new SoapParam($this->_userId, "UserID"),
            new SoapParam(Functions::getRemoteIp(), "IPAddress"),
            new SoapParam($this->_macaddress, "HardwareID"),
            new SoapParam($data->applicationId, "ApplicationID"),
            new SoapParam($application,"Application"),
            new SoapParam($applicants,"Applicant") <----- THIS IS AN ARRAY
        );

我需要在请求中看起来像这样:

<UpdateRequest>
   <MemberID>1</MemberID>
   etc etc...
   <Applicant>   <--------- REPEATING NODE
        .....
   </Applicant>
   <Applicant>
        .....
   </Applicant>
   <Applicant>
        .....
   </Applicant>
</UpdateRequest>

有什么想法吗?

0 个答案:

没有答案