Hi, Yes, we can send a HTTP OPTIONS request to a dataservice. But it gives all the HTTP options available for the server, not for a specific service. This is the current behavior.
Thanks. On Thu, Dec 5, 2013 at 11:36 AM, Samisa Abeysinghe <[email protected]> wrote: > Do we support HTTP OPTIONS in DSS? > > Thanks, > Samisa... > > > Samisa Abeysinghe > > Vice President Training > > WSO2 Inc. > http://wso2.com > > > > On Wed, Dec 4, 2013 at 3:14 PM, Samisa Abeysinghe <[email protected]> wrote: > >> https://wso2.org/jira/browse/DS-825 >> >> I raised it in DSS, but got to fix for the platform. >> >> Thanks, >> Samisa... >> >> >> Samisa Abeysinghe >> >> Vice President Training >> >> WSO2 Inc. >> http://wso2.com >> >> >> >> On Wed, Dec 4, 2013 at 3:10 PM, Sameera Jayasoma <[email protected]>wrote: >> >>> Hi Samisa/Anjana, >>> >>> I've faced the same problem sometime back when I was working on a DSS >>> based solution. At that I've raised the same concern in the dev list with >>> the following subject. >>> >>> "Enabling Http Content Negotiation by default in AS and DSS." >>> >>> Looks like this change is not available in the axis2.xml in 4.2.0 based >>> products. >>> >>> Thanks, >>> Sameera. >>> >>> >>> On Wed, Dec 4, 2013 at 3:01 PM, Anjana Fernando <[email protected]> wrote: >>> >>>> Hi, >>>> >>>> Yeah, maybe it should. Sameera, can we add this change to kernel's >>>> axis2.xml? .. @Chanika, check if we get the axis2.xml from the kernel, or >>>> if we have our own one. >>>> >>>> Cheers, >>>> Anjana. >>>> >>>> >>>> On Wed, Dec 4, 2013 at 2:54 PM, Samisa Abeysinghe <[email protected]>wrote: >>>> >>>>> Cool, that works. BTW, should not that parameter be set by default? >>>>> >>>>> Thanks, >>>>> Samisa... >>>>> >>>>> >>>>> Samisa Abeysinghe >>>>> >>>>> Vice President Training >>>>> >>>>> WSO2 Inc. >>>>> http://wso2.com >>>>> >>>>> >>>>> >>>>> On Wed, Dec 4, 2013 at 2:22 PM, Anjana Fernando <[email protected]>wrote: >>>>> >>>>>> Hi Samisa, >>>>>> >>>>>> I forgot one part, you need to add the following to the axis2.xml. >>>>>> >>>>>> <parameter name="httpContentNegotiation">true</parameter> >>>>>> >>>>>> Cheers, >>>>>> Anjana. >>>>>> >>>>>> >>>>>> On Wed, Dec 4, 2013 at 2:14 PM, Samisa Abeysinghe <[email protected]>wrote: >>>>>> >>>>>>> That seems a bug that accept does not work, but content-type does? >>>>>>> >>>>>>> Thanks, >>>>>>> Samisa... >>>>>>> >>>>>>> >>>>>>> Samisa Abeysinghe >>>>>>> >>>>>>> Vice President Training >>>>>>> >>>>>>> WSO2 Inc. >>>>>>> http://wso2.com >>>>>>> >>>>>>> >>>>>>> >>>>>>> On Wed, Dec 4, 2013 at 2:13 PM, Samisa Abeysinghe >>>>>>> <[email protected]>wrote: >>>>>>> >>>>>>>> However, I figured that >>>>>>>> curl -H "Content-Type: application/json" -X GET >>>>>>>> http://localhost:9763/services/samples/ResourcesSample.HTTPEndpoint/products >>>>>>>> works! >>>>>>>> >>>>>>>> >>>>>>>> Thanks, >>>>>>>> Samisa... >>>>>>>> >>>>>>>> >>>>>>>> Samisa Abeysinghe >>>>>>>> >>>>>>>> Vice President Training >>>>>>>> >>>>>>>> WSO2 Inc. >>>>>>>> http://wso2.com >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> On Wed, Dec 4, 2013 at 2:11 PM, Samisa Abeysinghe >>>>>>>> <[email protected]>wrote: >>>>>>>> >>>>>>>>> With the REST sample, I tried >>>>>>>>> curl -H "Accept: application/json" -X GET >>>>>>>>> http://localhost:9763/services/samples/ResourcesSample.HTTPEndpoint/products >>>>>>>>> >>>>>>>>> but it still returns XML. >>>>>>>>> >>>>>>>>> Thanks, >>>>>>>>> Samisa... >>>>>>>>> >>>>>>>>> >>>>>>>>> Samisa Abeysinghe >>>>>>>>> >>>>>>>>> Vice President Training >>>>>>>>> >>>>>>>>> WSO2 Inc. >>>>>>>>> http://wso2.com >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> On Wed, Dec 4, 2013 at 2:04 PM, Anjana Fernando >>>>>>>>> <[email protected]>wrote: >>>>>>>>> >>>>>>>>>> Hi Samisa, >>>>>>>>>> >>>>>>>>>> We don't actually have a specific sample for JSON as I know, >>>>>>>>>> Chanika was writing an article for this, with some scenarios, but >>>>>>>>>> didn't >>>>>>>>>> publish yet as I know. Chanika, do put a section to the docs to >>>>>>>>>> mention how >>>>>>>>>> to do JSON with DSS. >>>>>>>>>> >>>>>>>>>> The content negotiation in data service simply works by setting >>>>>>>>>> the HTTP header "Accept", with the content type as the value. For >>>>>>>>>> example, >>>>>>>>>> to get a JSON response, you would have a HTTP header like the >>>>>>>>>> following: >>>>>>>>>> >>>>>>>>>> "Accept: application/json". >>>>>>>>>> >>>>>>>>>> Cheers, >>>>>>>>>> Anjana. >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On Wed, Dec 4, 2013 at 12:52 PM, Samisa Abeysinghe < >>>>>>>>>> [email protected]> wrote: >>>>>>>>>> >>>>>>>>>>> To ask a related question, how do I do content negotiation with >>>>>>>>>>> DSS REST? >>>>>>>>>>> >>>>>>>>>>> Thanks, >>>>>>>>>>> Samisa... >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> Samisa Abeysinghe >>>>>>>>>>> >>>>>>>>>>> Vice President Training >>>>>>>>>>> >>>>>>>>>>> WSO2 Inc. >>>>>>>>>>> http://wso2.com >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> On Wed, Dec 4, 2013 at 12:32 PM, Samisa Abeysinghe < >>>>>>>>>>> [email protected]> wrote: >>>>>>>>>>> >>>>>>>>>>>> I am looking to do REST with JSON as content type with DSS. >>>>>>>>>>>> >>>>>>>>>>>> Do we have a sample that I can use to get started with? >>>>>>>>>>>> >>>>>>>>>>>> Thanks, >>>>>>>>>>>> Samisa... >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> Samisa Abeysinghe >>>>>>>>>>>> >>>>>>>>>>>> Vice President Training >>>>>>>>>>>> >>>>>>>>>>>> WSO2 Inc. >>>>>>>>>>>> http://wso2.com >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> -- >>>>>>>>>> *Anjana Fernando* >>>>>>>>>> Technical Lead >>>>>>>>>> WSO2 Inc. | http://wso2.com >>>>>>>>>> lean . enterprise . middleware >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> *Anjana Fernando* >>>>>> Technical Lead >>>>>> WSO2 Inc. | http://wso2.com >>>>>> lean . enterprise . middleware >>>>>> >>>>> >>>>> >>>> >>>> >>>> -- >>>> *Anjana Fernando* >>>> Technical Lead >>>> WSO2 Inc. | http://wso2.com >>>> lean . enterprise . middleware >>>> >>> >>> >>> >>> -- >>> Sameera Jayasoma, >>> Architect, >>> >>> WSO2, Inc. (http://wso2.com) >>> email: [email protected] >>> blog: http://sameera.adahas.org >>> twitter: https://twitter.com/sameerajayasoma >>> flickr: http://www.flickr.com/photos/sameera-jayasoma/collections >>> Mobile: 0094776364456 >>> >>> Lean . Enterprise . Middleware >>> >> >> > -- Best Regards.. Chanika Geeganage Software Engineer WSO2, Inc.; http://wso2.com
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
