Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » OM2M » IPU Lamp Sample(Send request to switch the lamp by using Rest client)
IPU Lamp Sample [message #1395157] Sun, 06 July 2014 13:15 Go to next message
hady delabe is currently offline hady delabeFriend
Messages: 5
Registered: July 2014
Junior Member
Hello everyone,
I just tested the sample provided with ipu.sample om2m project with my own client, in case the body of the request is empty all goes well:
By against when the body of the request is not empty I get an error:


Infos: ResponseConfirm [statusCode=STATUS_NOT_FOUND, representation=<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<om2m:errorInfo xmlns:om2m="..." xmlns:xmime=".../2005/05/xmlmime">
<om2m:statusCode>STATUS_NOT_FOUND</om2m:statusCode>
<om2m:additionalInfo>No IPU found for path APoCPath [path=lamps, accessRightID=gscl/accessRights/AR_ADMIN, searchStrings=null]</om2m:additionalInfo>
</om2m:errorInfo>
, resourceURI=null]
...RestHttpServlet service
Infos: HttpResponse [statusCode=404]


To understand the problem I am interested in InterworkingProxyController class and I noticed that in the case where the body of the request is not empty this is the
method doCreate is invoked and in this case the instance of the SampleController is null. I still do not understand why SampleController is null.

Thank's.

Re: IPU Lamp Sample [message #1396474 is a reply to message #1395157] Tue, 08 July 2014 10:52 Go to previous messageGo to next message
Mahdi Ben Alaya is currently offline Mahdi Ben AlayaFriend
Messages: 88
Registered: November 2013
Member
Hello,

This is an interesting question.
The ETSI M2M specification defines 5 methods to handle resources mapped to HTTP as follows:
Create->POST (with a non-empty body)
Retrieve->GET
Update->PUT
Delete->DELETE
Execute->POST (with an empty body)

The choice of the method type to use depends on your scenario, and in some cases you can perform the same scenario using two different methods.
For example, to switch ON/OFF a lamp you can:
- Use the Execute method (POST with an empty body) and add the required parameters (e.g. ON or OFF) in the URI. Your request will be routed to the doExecute() method of your controller. So you should implements the doExecute() method (This scenario is implemented for the ipu.sample).
- Use the Create method (POST with a non-empty body) an add the required parameters as XML representation in the body. You requested will be routed to the doCreate() method of your controller.
Re: IPU Lamp Sample [message #1396480 is a reply to message #1396474] Tue, 08 July 2014 11:02 Go to previous messageGo to next message
Mahdi Ben Alaya is currently offline Mahdi Ben AlayaFriend
Messages: 88
Registered: November 2013
Member
I pushed a minor update on the interworkingProxy controller, so I advice to reclone the project, then make a test.
Re: IPU Lamp Sample [message #1397629 is a reply to message #1396480] Thu, 10 July 2014 01:02 Go to previous message
hady delabe is currently offline hady delabeFriend
Messages: 5
Registered: July 2014
Junior Member
Hello, thank for your response, post request with a body works well now.

Thanks.

Hady
Previous Topic:Registration of a new Gateway Application
Next Topic:configuration of Remote Network SCL listening context for GSCL
Goto Forum:
  


Current Time: Sun May 03 13:57:57 GMT 2015

Powered by FUDForum. Page generated in 0.01576 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software