Forum
»
Support
»
API
»
Invalid date using webapi
  Rank: Paid supportJoined: 2/21/2011(UTC) Posts: 19
Thanks: 4 times Was thanked: 1 time(s) in 1 post(s)
|
I'm trying to use the webapi from soapUI to query the execution history for a job. This is my soap request: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:nweb="VisualCron/NWebService"> <soapenv:Header/> <soapenv:Body> <nweb:Log_Job_List> <!--Optional:--> <nweb:jobId>f5664ac5-6aed-4b5c-a11f-0e461fd0f9ca</nweb:jobId> <!--Optional:--> <nweb:startDate>2017-04-24T10:00:13+00:00</nweb:startDate> <!--Optional:--> <nweb:endDate>2018-04-24T10:00:13+00:00</nweb:endDate> </nweb:Log_Job_List> </soapenv:Body> </soapenv:Envelope> The following response is returned from VisualCron when executing this request, indicating that there is a problem with the date format. VC version is 8.1.2. Any pointers would be greatly appreciated, thank you. <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <s:Fault> <faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</faultcode> <faultstring xml:lang="en-ZA">String was not recognized as a valid DateTime.</faultstring> <detail> <ExceptionDetail xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <HelpLink i:nil="true"/> <InnerException i:nil="true"/> <Message>String was not recognized as a valid DateTime.</Message> <StackTrace>at System.DateTimeParse.ParseExact(String s, String format, DateTimeFormatInfo dtfi, DateTimeStyles style) at VisualCronService.WebService.Log_Job_List(String jobId, String startDate, String endDate) in C:\sourcefiles\code\VisualCronService\WebService\WebService.vb:line 580 at SyncInvokeLog_Job_List(Object , Object[] , Object[] ) at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace> <Type>System.FormatException</Type> </ExceptionDetail> </detail> </s:Fault> </s:Body> </s:Envelope> Edited by moderator Friday, March 30, 2018 10:40:36 AM(UTC)
| Reason: Not specified
|
|
|
|
  Rank: Paid supportJoined: 2/21/2011(UTC) Posts: 19
Thanks: 4 times Was thanked: 1 time(s) in 1 post(s)
|
I also upgraded VC to 8.3.4 and retried, still get the same error. <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <s:Fault> <faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</faultcode> <faultstring xml:lang="en-ZA">String was not recognized as a valid DateTime.</faultstring> <detail> <ExceptionDetail xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <HelpLink i:nil="true"/> <InnerException i:nil="true"/> <Message>String was not recognized as a valid DateTime.</Message> <StackTrace>at System.DateTimeParse.ParseExact(String s, String format, DateTimeFormatInfo dtfi, DateTimeStyles style) at VisualCronService.WebService.Log_Job_List(String jobId, String startDate, String endDate) in C:\sourcefiles\code\VisualCronService\WebService\WebService.vb:line 612 at SyncInvokeLog_Job_List(Object , Object[] , Object[] ) at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace> <Type>System.FormatException</Type> </ExceptionDetail> </detail> </s:Fault> </s:Body> </s:Envelope> Edited by user Thursday, March 22, 2018 3:27:28 PM(UTC)
| Reason: Not specified
|
|
|
|
  Rank: Official supportJoined: 2/23/2008(UTC) Posts: 11,222
Thanks: 875 times Was thanked: 446 time(s) in 424 post(s)
|
Try this format:
2002-05-30T09:00:00 |
|
|
|
|
  Rank: Paid supportJoined: 2/21/2011(UTC) Posts: 19
Thanks: 4 times Was thanked: 1 time(s) in 1 post(s)
|
Still the same issue Request: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:nweb="VisualCron/NWebService"> <soapenv:Header/> <soapenv:Body> <nweb:Log_Job_List> <!--Optional:--> <nweb:jobId>f5664ac5-6aed-4b5c-a11f-0e461fd0f9ca</nweb:jobId> <!--Optional:--> <nweb:startDate>2002-05-30T09:00:00</nweb:startDate> <!--Optional:--> <nweb:endDate>2012-05-30T09:00:00</nweb:endDate> </nweb:Log_Job_List> </soapenv:Body> </soapenv:Envelope> Response: <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <s:Fault> <faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</faultcode> <faultstring xml:lang="en-ZA">String was not recognized as a valid DateTime.</faultstring> <detail> <ExceptionDetail xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <HelpLink i:nil="true"/> <InnerException i:nil="true"/> <Message>String was not recognized as a valid DateTime.</Message> <StackTrace>at System.DateTimeParse.ParseExact(String s, String format, DateTimeFormatInfo dtfi, DateTimeStyles style) at VisualCronService.WebService.Log_Job_List(String jobId, String startDate, String endDate) in C:\sourcefiles\code\VisualCronService\WebService\WebService.vb:line 612 at SyncInvokeLog_Job_List(Object , Object[] , Object[] ) at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace> <Type>System.FormatException</Type> </ExceptionDetail> </detail> </s:Fault> </s:Body> </s:Envelope>
|
|
|
|
  Rank: Paid supportJoined: 2/21/2011(UTC) Posts: 19
Thanks: 4 times Was thanked: 1 time(s) in 1 post(s)
|
I even tried this, same result: Code:[indent]<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:nweb="VisualCron/NWebService">
<soapenv:Header/>
<soapenv:Body>
<nweb:Log_Job_List>
<!--Optional:-->
<nweb:jobId>f5664ac5-6aed-4b5c-a11f-0e461fd0f9ca</nweb:jobId>
<!--Optional:-->
<nweb:startDate>2002-05-30</nweb:startDate>
<!--Optional:-->
<nweb:endDate>2012-05-30</nweb:endDate>
</nweb:Log_Job_List>
</soapenv:Body>
</soapenv:Envelope>[/indent]
Edited by moderator Friday, March 30, 2018 10:39:06 AM(UTC)
| Reason: Not specified
|
|
|
|
  Rank: Paid supportJoined: 2/21/2011(UTC) Posts: 19
Thanks: 4 times Was thanked: 1 time(s) in 1 post(s)
|
Do you have any further suggestions that I can try?
|
|
|
|
  Rank: Official supportJoined: 2/23/2008(UTC) Posts: 11,222
Thanks: 875 times Was thanked: 446 time(s) in 424 post(s)
|
I suggest exploring it with SoapUI or similar tool to see exactly what is sent and received. We believe it should follow standards. |
|
|
|
|
  Rank: Paid supportJoined: 2/21/2011(UTC) Posts: 19
Thanks: 4 times Was thanked: 1 time(s) in 1 post(s)
|
The requests and responses I posted above is from soapUI.
Thanks, Nicki
|
|
|
|
  Rank: Official supportJoined: 2/23/2008(UTC) Posts: 11,222
Thanks: 875 times Was thanked: 446 time(s) in 424 post(s)
|
Originally Posted by: buzzlightyear  The requests and responses I posted above is from soapUI.
Thanks, Nicki I mean it does not seem that you have used SoapUI to read the WSDL to get the exact expected response. It seems that either something is missing or sent wrong. |
|
|
|
|
  Rank: Paid supportJoined: 2/21/2011(UTC) Posts: 19
Thanks: 4 times Was thanked: 1 time(s) in 1 post(s)
|
  I've attached screenshots from VC and soapUI showing the wsdl URLs
|
|
|
|
  Rank: Official supportJoined: 2/23/2008(UTC) Posts: 11,222
Thanks: 875 times Was thanked: 446 time(s) in 424 post(s)
|
I tried with standard army date / time and it worked: Code:<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:nweb="VisualCron/NWebService">
<soapenv:Header/>
<soapenv:Body>
<nweb:Log_Job_List>
<!--Optional:-->
<nweb:jobId>c6a11eec-56aa-4f83-9537-26e8b0aace86</nweb:jobId>
<!--Optional:-->
<nweb:startDate>2017-04-01 00:00:00</nweb:startDate>
<!--Optional:-->
<nweb:endDate>2019-04-01 00:00:00</nweb:endDate>
</nweb:Log_Job_List>
</soapenv:Body>
</soapenv:Envelope>
|
|
|
|
|
  Rank: Paid supportJoined: 2/21/2011(UTC) Posts: 19
Thanks: 4 times Was thanked: 1 time(s) in 1 post(s)
|
Thank you, after change my date format to match your example I no longer get an error.
|
 1 user thanked buzzlightyear for this useful post.
|
|
|
  Rank: Official supportJoined: 2/23/2008(UTC) Posts: 11,222
Thanks: 875 times Was thanked: 446 time(s) in 424 post(s)
|
Originally Posted by: buzzlightyear  Thank you, after change my date format to match your example I no longer get an error. Great! |
|
|
|
|
Users browsing this topic |
Guest (2)
|
Forum
»
Support
»
API
»
Invalid date using webapi
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.