1

I am consuming an API, written with C#, in my PHP application. One of the arguments required for a particular method is of type DateTime. I've tried the answers given in C# DateTime type over web service with PHP & SOAP, but none of those work.

I'm using the Soap extension. Also, the web service is written by a government agency, and I'm sure everyone who has consumed a government API knows how difficult it is to get them to change their arguments. So, I'd appreciate it if solutions wouldn't contain "talk to them and persuade them".

Community
  • 1
  • 1
Parham Doustdar
  • 2,019
  • 3
  • 22
  • 41

1 Answers1

2

It should actually be pretty simple.

Most Web services write datetime in the SOAP message as an ISO 8601 string. For example, 2014-11-15T18:32:17+00:00.

Here are several suggestions for writing an ISO 8601 format string with PHP:

STRONG SUGGESTION:

Get a copy of SoapUI and look at the actual SOAP message being passed between your PHP server and your C#/SOAP server:

Community
  • 1
  • 1
paulsm4
  • 114,292
  • 17
  • 138
  • 190