ODATA - How to call association

0
Hi everybody, I was wondering what the best way would be to call associations of an odata service. I'm able to get a list for example using the well known: @Module.odataurl + '/' + toString(Module.EntitySetNames.AnySet) But assuming I get a list of objects from this call, lets call them “ObjectResult”, how would an association call look like if the association name would be something like “AnySetAssociation”? I think I'm confused because of the Parent parameter that is mentioned in the java call to get a list. Do I need to provide the retrieved object or does the microflow already knows it is there? I can only think of something like @Module.odataurl + '/' + toString(Module.EntitySetNames.AnySet) + '(' + ObjectResultKey + ')' + '/' + toString(Module.EntitySetNames.AnySetAssociation. Hope you can help and that the question isn't to “vague” :-) Kind regards Laurens <edition> Just tested a few of the standard Odata examples Mendix has as an application (purchaseorder etc) and I discovered the odataquerybuilder. Let's start there first ;-)
asked
3 answers
0

Hi Laurens,

 

How do you know that the Odata service expose the association like you would expect? Is it a Mendix application exposing like that? In most cases whenintegrating with a non-Mendix oData service it is high likely a different domain model, so the exposed service (domain) is set up differently.

 

How I get normally oData implemented is:

1 – get just the response with Postman, by executing the oData get call including the headers

http://hostY:8090/serviceX/odata/Artikel?&$expand=ArtikelEigenschappen&$filter=GewijzigdOp%20ge%202017-12-15T00:00:00.000Z

2 – based on the response of 1 ( a JSON) you can create a JSON structure and IMPORT mapping to your domain model,  and create the non persistent entities based on the response

3 – Then you can do whatever you want towards the other (non) persistent objects of your choice, including the associated objects etc.

 

answered
0

I think I've got it. Looks like you can construct it all by yourself, or just use the parent (see Query where the parent used is the PurchaseOrder.)

 

answered
0

Hi everybody,

So I'm finally integrating a sap odata service (reverse proxy) but I'm still struggling with the association part. I use the method as described above but somehow I get a 403 error (nothing more). Funny thing is that when I get the url from debugging and put that into the browser, all works well. I included the current CSRF token as well in the call.

So, current call is: $ENTITYFROMSAP/TO_OTHERENTITYDeferred   (just like the Purchaseorder example)

Anyone got an idea what could cause the problem of 403?

Thanks!

Laurens

answered