php - 不是有效的 AllXsd 值

标签 php xml soap

我从一个 Soap 客户端请求中得到了这个:

Exception: SoapFault exception: [soap:Client] Server was unable to read request. ---> There is an error in XML document (2, 273). ---> The string '2010-5-24' is not a valid AllXsd value. in /path/filinet.php:21 Stack trace: #0 [internal function]: SoapClient->__call('SubIdDetailsByO...', Array) #1 /path/filinet.php(21): SoapClient->SubIdDetailsByOfferId(Array) #2 {main}

似乎我发送了一个不正确的值,如何在 php 的 AllXsd 中格式化我的值?

这是我的代码:

<?php       
$start = isset($_GET['start']) ? $_GET['start'] : date("Y-m-d");
$end = isset($_GET['end']) ? $_GET['end'] : date("Y-m-d");

//define parameter array
$param = array('userName'=>'user', 'password'=>'pass', 'startDate' => $start, 'endDate' => $end, 'promotionId' => '');

//Get wsdl path
$serverPath = "https://webservices.filinet.com/affiliate/reports.asmx?WSDL";

 //Declare Soap client
 $client = new SoapClient($serverPath);
 try {
        //make the call
        $result = $client->SubIdDetailsByOfferId($param);
        //If error found display error
        if(isset($fault))
        {
            echo "Error: ". $fault;
        }
        //If no error display response
        else
        {
            //Used to display raw XML in the Web Browser
            header("Content-Type: text/xml;");
            //SubIdDetailsResult = XML results
            echo $result->SubIdDetailsByOfferIdResult;
        }
    }
    catch(SoapFault $ex) {
        echo "<b>Exception:</b> ". $ex;
    }
unset($client);
?>

最佳答案

AllXsd 值看起来像这样的 IIRC

2010-05-24T18:13:00

关于php - 不是有效的 AllXsd 值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2899332/

相关文章:

php - MySQL查询选择数据

php - flock 处理时会发生什么?

wpf - 为什么在我使用 ParserContext 时 XamlReader 会抛出异常?

xmlstarlet:过滤掉具有属性的元素

c# - 陷入 C# 中循环 XML 的思路中

php - 信封': No matching global declaration available for the validation root error when validating SOAP response in php

Polarion ALM的API有时不授权任何请求

php - MySql连接问题3表

php - 将行转换为列

java - 在 Mule 流中使用安全的 SOAP Web 服务