Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

not a valid AllXsd value

Tags:

php

soap

xml

I got this from a Soap client request:

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}

Seems like I am sending an incorrect value, how do I format my value in an AllXsd in php?

Here is my code:

<?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);
?>
like image 708
Loreto Gabawa Jr. Avatar asked May 24 '10 18:05

Loreto Gabawa Jr.


1 Answers

AllXsd values look something like this IIRC

2010-05-24T18:13:00

like image 80
Ólafur Waage Avatar answered Sep 19 '22 17:09

Ólafur Waage