You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@olingo.apache.org by Mikael Thyman <mi...@mblox.com> on 2016/04/01 16:47:21 UTC

Problems with bound action in 4.1.0

Hi!

I'm new to both OData and Olingo so this might be a newbie question but I'm
trying to add a bound action to my API and I can't get it to work.

My entity name is 'campaign_order', its entity set is 'campaign_orders' and
my action is 'submit'

If I do POST http://localhost:8081/campaign_orders(1)/submit I get

404 Not Found
{"error":{"code":null,"message":"The type 'com.mblox.aps.campaign_order'
has no property 'submit'."}}

Debug gist:

https://gist.github.com/mthyman/4441dd8610977775ea57366da1402507

Looking at the stacktrace and digging around
in org.apache.olingo.server.core.uri.parser.UriParseTreeVisitor I noticed
that the behavior is different if the namespace is available and if I do

POST http://localhost:8081/campaign_orders(1)/com.mblox.aps.submit

Then I get 501 Not Implemented, which is expected at this point. I can see
that Olingo looks up my action in the my CsdlEdmProvider.

Is there something else that I need to do for the URI Parser to recognize
my bound action without using a namespace or have I stumbled upon a bug? I
did a quick check with 4.2.0-RC01 before sending this and I got the same
behavior.

Thanks!

*Mikael Thyman*

*D* EX 7833


mblox.com <http://www.mblox.com> | @mblox

-- 


 

*NOTE: This message and any attached files may contain information that is 
confidential and/or subject of legal privilege. If you are not the intended 
recipient or the person responsible for delivering the message, be advised 
that you have received this message in error and that any dissemination, 
copying or use of this message or attachment is forbidden, as is the 
disclosure of the information therein. If you have received this message in 
error please notify the sender immediately and delete the message.*

Re: Problems with bound action in 4.1.0

Posted by mibo <mi...@apache.org>.
Hi Mikael,


In the OData V4 specification is defined that bound actions must be requested via its „qualified action name“, see:
http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part1-protocol.html#_Invoking_an_Action


and
http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part3-csdl/odata-v4.0-errata02-os-part3-csdl-complete.html#_Toc406398008




Based on that you need the namespace and if I understand your mail correct, with the namespace the dispatching works as expected, or?


Best Regards, Michael





> On Apr 1, 2016, at 4:47 PM, Mikael Thyman <mi...@mblox.com> wrote:
> 
> 
> Hi!
> 
> I'm new to both OData and Olingo so this might be a newbie question but I'm trying to add a bound action to my API and I can't get it to work.
> 
> My entity name is 'campaign_order', its entity set is 'campaign_orders' and my action is 'submit'
> 
> 
> If I do POST http://localhost:8081/campaign_orders(1)/submit
> I get
> 
> 
> 404 Not Found
> {"error":{"code":null,"message":"The type 'com.mblox.aps.campaign_order' has no property 'submit'."}}
> 
> 
> 
> Debug gist:
> 
> 
> https://gist.github.com/mthyman/4441dd8610977775ea57366da1402507
> 
> 
> 
> 
> Looking at the stacktrace and digging around in org.apache.olingo.server.core.uri.parser.UriParseTreeVisitor I noticed that the behavior is different if the namespace is available and if I do
> 
> 
> POST http://localhost:8081/campaign_orders(1)/com.mblox.aps.submit
> 
> 
> 
> Then I get 501 Not Implemented, which is expected at this point. I can see that Olingo looks up my action in the my CsdlEdmProvider.
> 
> 
> Is there something else that I need to do for the URI Parser to recognize my bound action without using a namespace or have I stumbled upon a bug? I did a quick check with 4.2.0-RC01 before sending this and I got the same behavior. 
> 
> 
> Thanks!
> 
> Mikael Thyman
> 
> D EX 7833
> 
> <embedded image>
> mblox.com
>  | @mblox 
> 
> 
> 
> 
> 
> 
>  
> 
> 
> 
> 
> NOTE: This message and any attached files may contain information that is confidential and/or subject of legal privilege. If you are not the intended recipient or the person responsible for delivering the message, be advised that you have received this message in error and that any dissemination, copying or use of this message or attachment is forbidden, as is the disclosure of the information therein. If you have received this message in error please notify the sender immediately and delete the message.
> 
> 
>