Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » OM2M » Adding aPoC via REST API(How to set up application attributes from the REST API)
Adding aPoC via REST API [message #1385342] Thu, 05 June 2014 17:57 Go to next message
Mario Jagar is currently offline Mario JagarFriend
Messages: 2
Registered: June 2014
Junior Member
Hello guys, first of all i would like to start by saying you did an excellent job on this project everything looks and works great!

Unfortunately I'm still learning how to use all of this and was wondering if you can help me solve a problem.

I need to add an aPoC attribute to my application but cant seam to accomplishe this. The normal way of adding trough REST API as explained here : ( wiki.eclipse.org/OM2M/REST_API )
works great, but when i try to add the aPoC attribute i get an error message i don't understand. Here is what i did:

I sent to URI: h t t p ://127.0.0.1:8080/om2m/gscl/applications
this XML:
<om2m:application xmlns:om2m="h t t p://uri.etsi.org/m2m" appId="test">
   <om2m:searchStrings>
      <om2m:searchString>Type/streamingSensor</om2m:searchString>
      <om2m:searchString>Category/streaming</om2m:searchString>
      <om2m:searchString>Location/FER</om2m:searchString>
   </om2m:searchStrings>

  <m2m:aPoC>c o a p://[::1]:5685/zigbee/APP_00137a0000004ae9.10</m2m:aPoC>
    <m2m:aPoCPaths>
        <m2m:aPoCPath>
            <m2m:path>/m2m/applications/APP_00137a0000004ae9.10/retargeting1</m2m:path>
            <m2m:accessRightID>/m2m/accessRights/Locadmin_AR2</m2m:accessRightID>
        </m2m:aPoCPath>
        <m2m:aPoCPath>
            <m2m:path>/m2m/applications/APP_00137a0000004ae9.10/retargeting2</m2m:path>
            <m2m:accessRightID>/m2m/accessRights/APP_00137a0000004ae9.10_AR2</m2m:accessRightID>
        </m2m:aPoCPath>
        <m2m:aPoCPath>
            <m2m:path>/m2m/applications/APP_00137a0000004ae9.10/retargeting3</m2m:path>
            <m2m:accessRightID>/m2m/accessRights/APP_00137a0000004ae9.10_AR3</m2m:accessRightID>
        </m2m:aPoCPath>
    </m2m:aPoCPaths>

</om2m:application>


As you can see i just added the m2m:aPoC. The result i get is this:
<om2m:statusCode>STATUS_BAD_REQUEST</om2m:statusCode>
    <om2m:additionalInfo>Resource representation syntax error: The prefix &quot;m2m&quot; for element &quot;m2m:aPoC&quot; is not bound.</om2m:additionalInfo>


Am I adding it to the wrong address or is the format wrong? Don't know what I'm doing wrong. When adding the searchString everything works fine, but cant seam to add anything else.

So my question is: how do i add other attributes to my application, more specifically how do i add the aPoC attribute?
Re: Adding aPoC via REST API [message #1385487 is a reply to message #1385342] Fri, 06 June 2014 22:03 Go to previous messageGo to next message
Mario Jagar is currently offline Mario JagarFriend
Messages: 2
Registered: June 2014
Junior Member
So i figured out the answer and if anyone should need it here it:

<?xml version="1.0" encoding="UTF-8"?>
 <m2m:application appId="STREAMING_DEVICE" xmlns:m2m="h t t p://uri.etsi.org/m2m">
 <m2m:searchStrings>
 	<m2m:searchString>ETSI.ObjectType/ETSI.AN_APP</m2m:searchString>
 	<m2m:searchString>ETSI.NetworkID/myNetwork</m2m:searchString>
 	<m2m:searchString>ETSI.NodeID/myDevice</m2m:searchString>
 </m2m:searchStrings>
 <m2m:aPoC>coap://[::1]:1111/exampleArduinuoIP</m2m:aPoC>
 <m2m:aPoCPaths>
 	<m2m:aPoCPath>
 		<m2m:path>openStream</m2m:path>
 		<m2m:accessRightID>/m2m/accessRights/Locadmin_AR</m2m:accessRightID>
 	</m2m:aPoCPath>
 </m2m:aPoCPaths>
 </m2m:application>
Re: Adding aPoC via REST API [message #1386512 is a reply to message #1385487] Wed, 18 June 2014 04:03 Go to previous message
Mahdi Ben Alaya is currently offline Mahdi Ben AlayaFriend
Messages: 229
Registered: November 2013
Senior Member
Hello Mario,

I see that you are interested in the CoAP protocol. We are now finalizing our CoAP binding module which is developed based on the Eclipse Californium project. OM2M will be able to handle at the same time HTTP and COAP requests. We will push the CoAP plugin in few days.


Previous Topic:Start NSCL
Next Topic:Zigbee IPU plugin
Goto Forum:
  


Current Time: Tue Apr 23 09:51:04 GMT 2024

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

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

Back to the top