SOAPUI 日期格式错误

Ben*_*pos 4 xml soap web-services soapui date-format

我是新来的,如果我发布问题时犯了任何错误,请抱歉。我正在使用 SOAPUI 来测试 Web 服务。在 Soap 消息中,我需要添加 StartDate 和 EndDate,但出现错误(输入字符串的格式不正确)。我尝试了在互联网上找到的几种 DateFormat,但仍然遇到相同的错误。

这里有 SOAPUI 参数。

谢谢

<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>
Run Code Online (Sandbox Code Playgroud)

小智 5

尝试可排序的日期/时间模式,它对我有用

Console.WriteLine(date1.ToString("S", CultureInfo.CreateSpecificCulture("en-US"))); 
Run Code Online (Sandbox Code Playgroud)

在 XML 中

 <tem:StartDate>2014-01-10T15:51:24</tem:StartDate>
 <tem:EndDate>2018-01-10T15:51:24</tem:EndDate>
Run Code Online (Sandbox Code Playgroud)