Reputation: 41
I am new here, sorry if I make any mistake posting my question. I am using SOAPUI to test a web service. Inside the Soap message, I need to add an StartDate and EndDate but I am getting as a error (Input string was not in a correct format) I been trying several DateFormat that I found over the internet by I still getting the same error.
Here you have the SOAPUI parameters.
Thanks
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header>
<tem:Message>
<!--Optional:-->
<tem:Value>?</tem:Value>
</tem:Message>
<tem:APIKeyHeader>
<!--Optional:-->
<tem:Value>cbe40420</tem:Value>
</tem:APIKeyHeader>
</soapenv:Header>
<soapenv:Body>
<tem:GetTasks>
<!--Optional:-->
<tem:PIDs>
<!--Zero or more repetitions:-->
<tem:string>2857fd7c-a720</tem:string>
</tem:PIDs>
<!--Optional:-->
<tem:UserID>blue</tem:UserID>
<!--Optional:-->
<tem:IDs>
<!--Zero or more repetitions:-->
<tem:string>?</tem:string>
</tem:IDs>
<!--Optional:-->
<tem:TaskStatus>true</tem:TaskStatus>
<tem:StartDate>2008-10-26T21:32:52.12679</tem:StartDate>
<tem:EndDate>2014-10-26T21:32:52.12679</tem:EndDate>
<tem:ExtentionDays>true</tem:ExtentionDays>
<tem:ShowNotReady>false</tem:ShowNotReady>
</tem:GetTasks>
</soapenv:Body>
</soapenv:Envelope>
Upvotes: 4
Views: 61214
Reputation: 29
You have to provide a date in the format that web-service expect. i.e 2008-10-26
Upvotes: 0
Reputation: 85
Try the Sortable Date/Time Pattern, it works for me
Console.WriteLine(date1.ToString("S", CultureInfo.CreateSpecificCulture("en-US")));
IN XML
<tem:StartDate>2014-01-10T15:51:24</tem:StartDate>
<tem:EndDate>2018-01-10T15:51:24</tem:EndDate>
Upvotes: 5