SOAPUI DateFormat错误 [英] SOAPUI DateFormat error

查看:85
本文介绍了SOAPUI DateFormat错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

这里有SOAPUI参数。

Here you have the SOAPUI parameters.

谢谢

<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>


推荐答案

尝试可排序的日期/时间模式,适用于我

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>

这篇关于SOAPUI DateFormat错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆