使用复杂类型的PHP发送SOAP请求

时间:2016-06-28 12:49:28

标签: php xml soap

我必须创建一个soap请求来匹配此输入xml

 class Custom{
public $DisbursedAmount_L;
public $HoldingNo_L;
public $TransactionalStatus_L;
public $DateofPurchase_L;       

    function __construct($DisbursedAmount_L,$HoldingNo_L,$TransactionalStatus_L,$DateofPurchase_L) {
            $this->DisbursedAmount_L = $DisbursedAmount_L;
            $this->HoldingNo_L = $HoldingNo_L;
            $this->TransactionalStatus_L = $TransactionalStatus_L;
            $this->DateofPurchase_L = $DateofPurchase_L;
        }


    }


    class nextObject
    {
    public $LeadKey;
    public $StatusCodeKey;

    function __construct(Custom $custom,$leadkey,$statuskey) {

        $this->Custom=$custom;      
        $this->LeadKey = $leadkey;
        $this->StatusCodeKey = $statuskey;  

    }

}
$custom_obj=new Custom(1,2,3,4);
$custom_obj1=new Custom(5,6,7,8);

$sdetail=array(); 
array_push($sdetail, new nextObject($custom_obj,'sgd','sgfd'));
array_push($sdetail, new nextObject($custom_obj1,'abc','def'));

 $data = $wsclient->Save(array("userContext" => $obj_usrdisp, "objects"=>$sdetail, "returnObjectOnSave" => false));
                 echo htmlentities($wsclient->__getLastRequest());

如何使用api:tagname创建标签?另外,如何将xmlns:xsi和xsi:type添加到标记中。请帮忙!我对soap很新,我对这个复杂的结构感到困惑,并且我总是得到一个没有设置为对象的错误对象引用。

我的代码:

<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.crmnext.com/api/"><SOAP-ENV:Body><ns1:Save><ns1:userContext><ns1:IsSuccess>true</ns1:IsSuccess><ns1:ExpiresOn>2016-06-29T12:31:20.435685+05:30</ns1:ExpiresOn><ns1:IsUTC>false</ns1:IsUTC></ns1:userContext><ns1:objects><ns1:CRMnextObject/><ns1:CRMnextObject/></ns1:objects><ns1:returnObjectOnSave>false</ns1:returnObjectOnSave></ns1:Save></SOAP-ENV:Body></SOAP-ENV:Envelope>

最后一次请求的o / p

options(java.parameters = "-Xmx8048m")
library("RJDBC")

0 个答案:

没有答案