cancel
Showing results for 
Search instead for 
Did you mean: 

How to Pass DateTime value in $batch for GET operation

Former Member
0 Kudos

Hi All,

I am trying to call a GET operation in $batch  my request content looks like this.

--batch_005

Content-Type: application/http

Content-Transfer-Encoding: binary

GET LRI004LANERENTALJOBS(FromDate=datetime'2014-08-10T00:00:00',OperationDist='TD - TRANSPORT FOR LONDON ROAD NETWORK',Sapid='TST_PORT_USR',ToDate=datetime'2014-09-24T00:0:00',Historical='X',JobNum='555') HTTP/1.1

--batch_005--

I am getting the below error:

Resource not found for the segment '00:00',OperationDist='TD'.

Same URI is working for general GET operation.

I am suspecting it could be DateTime value is not formed well.

Can anybody suggest.

Regards,

Kiran Adhikarla

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Kiran,

Though I have not worked with $batch,

I tried the following simple request body for batch and i am not getting any error also i am not getting a request body.

--batch

Content-Type: application/http

Content-Transfer-Encoding: binary

GET DecimalSet(TestDateTime=datetime'2014-08-08T00:00:00',TestDecimal=100.9m HTTP/1.1

--batch--


"TestDateTime- property is of type edm.datetime".

I don't think it is your date.

Regards,

Jhansi.

Former Member
0 Kudos

Hi Jhansi,

I have tried by changing the property/length but its not worked for me.

Even with the other entity set same error is occurring.

In your GET statement you are not closed the bracket.

I guess it should be like this

GET DecimalSet(TestDateTime=datetime'2014-08-08T00:00:00',TestDecimal=100.9m) HTTP/1.1



Regards,

Kiran Adhikarla

Former Member
0 Kudos

Hi All,

Give the date time field value like as 'yyyy-mm-ddT00%3A00%3A00' .

Below is the sample batch request payload. It is working fine for me.

--batch

Content-Type: application/http

Content-Transfer-Encoding: binary

GET DecimalSet(TestDateTime=datetime'2014-08-08T00%3A00%3A00') HTTP/1.1

--batch--

Regards,

Sandhya.

Former Member
0 Kudos

Hi Sandhya,

Thanks lot its working fine now.

Same way i developed for query also.

Below is the sample.

GET LRI004LANERENTALJOBS?$filter=ToDate+eq+datetime'2014-09-24T00%3A00%3A00'+and+Sapid+eq+'TST_PORT_USR'+and+OperationDist+eq+'TD%20-%20TRANSPORT%20FOR%20LONDON%20ROAD%20NETWORK'+and+FromDate+eq+datetime'2014-08-10T00%3A00%3A00'+and+Historical+eq'X'+and+JobNum+eq+'555' HTTP/1.1

Regards,

Kiran Adhikarla

Answers (0)