question

Upvotes
Accepted
97 8 11 13

REDI API cancel order by OrderRefKey

I have the following code but it throws type mismatch.

object err = null;
rediCache.Submit("Message", "Status==0 || Status==1 || Status==2 || Status==3", ref err);
rediCache.CancelByKey(redi_user_id, "gS01568314", ref err);

System.Runtime.InteropServices.COMException: 'Type mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))'

Could you also explain whether .submt() is necessary and what those status denotes?

Additionally, is there anything I must do when stopping application? Sometimes I noticed REDI hangs after I abruptly terminate redi api application.

Thank you!

apiredi-apiorder
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
Accepted
78.1k 246 52 72

@39783854-26aa-4fea-bc93-00b2ec21f8bb

I got the same exception if CancelByKey is called immediately after Submit. It works fine if I call CancelByKey in the CacheEvent handler.

However, from my test, the CancelByKey can be called without Submit.

object err = null;

rediCache.CancelByKey(redi_user_id, "gS01568314", ref err);

The meanings of status codes and where options are mentioned in Appendix A REDI Data Fields in the REDI API SPECIFICATION.

 '======= REDI ORDER STATUS TABLE (status) =============
 ' 0: Open  1: Partial  2: Complete 3: Canceled 4: Reject
 ' 5: Deleted  6: Failed  7: Pending Reroute 8: Pending
 '======================================================

For the hang issue, we need more information. Could you please share the application and steps to replicate the problem?

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
97 8 11 13

it worked with just submit as you had stated.

I got the example from REDI API pdf

1.10 Order Cancellation

Cancelling an Order By ‘OrderRefKey
Public WithEvents OrderQuery As CacheControl

Sub CancelOrder() Set OrderQuery = New CacheControl
Dim verr, table, where
table = “Message”
where = “Status==0 || Status==1 || Status==2 || Status==3”
OrderQuery.Submit table, where, verr
‘ Cancel Order
OrderQuery.CancelByKey “parkmm”, “YSJ1069332”, verr End Sub
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
97 8 11 13

it worked with just submit as you had stated.

I got the example from REDI API pdf

1.10 Order Cancellation

Cancelling an Order By ‘OrderRefKey
Public WithEvents OrderQuery As CacheControl

Sub CancelOrder() Set OrderQuery = New CacheControl
Dim verr, table, where
table = “Message”
where = “Status==0 || Status==1 || Status==2 || Status==3”
OrderQuery.Submit table, where, verr
‘ Cancel Order
OrderQuery.CancelByKey “parkmm”, “YSJ1069332”, verr End Sub
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
97 8 11 13

it worked with just submit as you had stated.

I got the example from REDI API pdf

1.10 Order Cancellation

Cancelling an Order By ‘OrderRefKey
Public WithEvents OrderQuery As CacheControl

Sub CancelOrder() Set OrderQuery = New CacheControl
Dim verr, table, where
table = “Message”
where = “Status==0 || Status==1 || Status==2 || Status==3”
OrderQuery.Submit table, where, verr
‘ Cancel Order
OrderQuery.CancelByKey “parkmm”, “YSJ1069332”, verr End Sub
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
97 8 11 13

sorry about duplicate posts. My browser hung...

link to redi doc.

https://developers.thomsonreuters.com/transactions/redi-api/docs?content=25822&type=documentation_item

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.