Invalid date using webapi - VisualCron - Forum

Community forum

buzzlightyear
2018-03-22T12:32:11Z
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[]&amp; outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp; rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp; rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&amp; rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace>
<Type>System.FormatException</Type>
</ExceptionDetail>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
buzzlightyear
2018-03-22T14:26:40Z
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[]&amp; outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp; rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp; rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc&amp; rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace>
<Type>System.FormatException</Type>
</ExceptionDetail>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
Support
2018-03-22T18:45:05Z
Try this format:

2002-05-30T09:00:00
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
buzzlightyear
2018-03-23T07:33:00Z
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[]&amp; outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp; rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp; rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc&amp; rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace>
<Type>System.FormatException</Type>
</ExceptionDetail>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
buzzlightyear
2018-03-23T10:10:51Z
I even tried this, same result:

[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]
buzzlightyear
2018-03-27T14:43:07Z
Do you have any further suggestions that I can try?
Support
2018-03-27T14:56:25Z
I suggest exploring it with SoapUI or similar tool to see exactly what is sent and received. We believe it should follow standards.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
buzzlightyear
2018-03-28T12:17:30Z
The requests and responses I posted above is from soapUI.

Thanks,
Nicki
Support
2018-03-28T19:46:03Z
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.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
buzzlightyear
2018-03-29T09:14:35Z
VC.png soapui.png

I've attached screenshots from VC and soapUI showing the wsdl URLs
Support
2018-03-30T08:38:46Z
I tried with standard army date / time and it worked:

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

Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
buzzlightyear
2018-04-09T07:48:00Z
Thank you, after change my date format to match your example I no longer get an error.
Support
2018-04-09T07:52:39Z
Originally Posted by: buzzlightyear 

Thank you, after change my date format to match your example I no longer get an error.



Great!

Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top