0

我正在尝试使用 PHP SOAP 客户端进行 SOAP 调用(TravelGuard API),就像这样。

$arr = array('asdasdasd'=>array(
                'asdasd'=>array(
                        'asdasd'=>array(
                                'asdsad'=>'008573',
                                'asdasd'=>'114846',
                                'asdasd'=>'Quote',
                                'asasdasd'=>'1',
                                'asdasdas'=>'4000.00',
                        ),
                        'asdasd'=>array(
                                'asdas'=>array(
                                        'asdasd'=>'4000.00'
                                ),
                        ),
                        'asdasd'=>array(
                                'asdasd'=>'21-09-2012',
                                'asdasd'=>'10-10-2012',
                                'asdasd'=>'22-08-2012',
                        )
                )
        )
        );



        $options = array(
               'soap_version'=>SOAP_1_1, 
               'exceptions'=>true, 
               'trace'=>1,'encoding'=>'utf-8'
               );
        $this->client = new SoapClient($this->PDUrl, $options);

        //$xmlVar = new SoapVar($xml, XSD_ANYXML);

        $res = $this->client->getQuote(array('xmlString'=>$arr));
        var_dump($res);exit;

这将返回带有代码'101010'和描述的错误'XML String empty'

支持团队建议我将 XML 部分包装在 CDATA 字符串中。我怎样才能做到这一点?

4

0 回答 0