SOAP PHP date time issue

When passing array in SOAP request like this, its working fine

$parameters = array(date'=>'2016-08-27T00:00:00','aa'=>'aaaa');

But when i store the date value in a php variable and pass its showing error

$date = '2016-08-27T00:00:00';
$parameters = array(date'=>'$date','aa'=>'aaaa');

Fault code: soap:Client Fault string: Server was unable to read request. ---> There is an error in XML document (2, 592). ---> The string '$date' is not a valid AllXsd value.

Answers


The $date value will be passed litterally as '$date' instead of '2016-08-27T00:00:00'. Use double quotes instead (or no quotes at all):

$parameters = array('date'=>"$date",'aa'=>'aaaa');

Need Your Help

$_POST into PHP define string [closed]

php xml post http-post http-post-vars

I am attempting to insert the $_POST inputs from a form into a php page. Is there any reason that this shouldn't work? I'm not getting any errors, but I am also not getting the intended result

Mongoid Moped could not resolve IP address for… remote MongoDB

ruby mongodb mongoid moped

I can connect just fine to a local MongoDB, but when I try connecting to either MongoHQ or DotCloud instance using Ruby Mongoid, then I get the above error message.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.