-
1. Re: Teiid/oData - Is it possible expose virtual procedure with post method?
rareddy Sep 28, 2018 8:37 PM (in response to angeladdati)What does this procedure return? If it returns a LOB or if you set the UpdateCount property on the Virtual Procedure to > 0 then it will be modelled as Action, which is executed with POST
-
2. Re: Teiid/oData - Is it possible expose virtual procedure with post method?
angeladdati Oct 1, 2018 3:03 PM (in response to angeladdati)Hi Ramesh:
The procedure returns an string: "ok" or "error xxx: bla bla bla". Do you have some suggestion?
Thank you. Regards.
Angel -
3. Re: Teiid/oData - Is it possible expose virtual procedure with post method?
rareddy Oct 1, 2018 4:45 PM (in response to angeladdati)Set the UpdateCount > 0 on the model then.
-
4. Re: Teiid/oData - Is it possible expose virtual procedure with post method?
angeladdati Oct 2, 2018 9:55 AM (in response to rareddy)It doesn't work for me. Maybe I don't understad the complete change.
I defined the following. Do I need add some definition in other section? Do yo see something wrong?
CREATE VIRTUAL PROCEDURE update_estaciones (IN pactivo STRING,
IN jsonestaciones STRING)
RETURNS table(estacion_sk BIGDECIMAL,
MensError VARCHAR(200)) OPTIONS (UPDATECOUNT 4, "REST:METHOD" 'POST')
AS
...
Thank you so much. Regards.
Angel -
5. Re: Teiid/oData - Is it possible expose virtual procedure with post method?
rareddy Oct 2, 2018 2:33 PM (in response to angeladdati)Does it show up as an "Action" or "Function" in your OData metadata? Action is executed with POST.
BTW, when working with OData none of "REST:" methods apply, those are only for when you want to expose custom REST API.
Ramesh..
-
6. Re: Teiid/oData - Is it possible expose virtual procedure with post method?
angeladdati Oct 2, 2018 4:05 PM (in response to rareddy)Oks, I understood wrong the use of the custom REST API.
Where can I see the "Action" or "Funcion". In he $metadata, for the procedure, I only see:
<FunctionImport Name="update_estaciones" ReturnType="Collection(TOW_CONS.update_estaciones_t)" m:HttpMethod="GET" dsds:elementType="TOW_CONS.update_estaciones_t" dsds:isCollection="true" dsds:procedureType="1">
<Parameter Name="pactivo" Type="Edm.String" Mode="In" Nullable="true" />
<Parameter Name="jsonestaciones" Type="Edm.String" Mode="In" Nullable="true" />
</FunctionImport>
-
7. Re: Teiid/oData - Is it possible expose virtual procedure with post method?
rareddy Oct 3, 2018 9:29 AM (in response to angeladdati)yes, above is showing as a Function, not an Action. A function by definition means an immutable request in OData. Also the above does not seem to be generated from Teiid VDB. Teiid does not put any "dsds:" namespaces in the metadata. Which service created the metadata?
-
8. Re: Teiid/oData - Is it possible expose virtual procedure with post method?
angeladdati Oct 3, 2018 11:05 AM (in response to rareddy)Oks. But Is it possible to change the "GET" to "POST"?
We have so customization in the Teiid, so it put the dsds.
Regards.Angel
-
9. Re: Teiid/oData - Is it possible expose virtual procedure with post method?
rareddy Oct 3, 2018 11:15 AM (in response to angeladdati)BTW, the way you are adding the additional metadata to the OData elements is not specification compliant, you should look into 'Annotations' in OData to define the same data the right way. It is possible that external clients other than your own might fail with the metadata.
Since it looks like you already changed the original Teiid implementation not to honour the UPDATECOUNT > 0 to be ACTION, you need to come up your own semantics of making a Virtual Procedure execute as POST or debug to see why UPDATECOUNT is not working. In my local testing of the UPDATECOUNT I find it working correctly as expected.
Ramesh..