cancel
Showing results for 
Search instead for 
Did you mean: 

Behaviour of REGISTER_DEVICE api

Former Member
0 Kudos

Hi All,

i would like to know the behaviour of REGISTER_DEVICE api.

In sdoe_dev_register transaction i have made the device name as a mandatory field for registration.

Thanks and Regards,

Joseph Beevin.

Accepted Solutions (0)

Answers (3)

Answers (3)

maciola
Explorer
0 Kudos

I tried to send various kinds registration requests via ICF to functional module REGISTER_DEVICE but without successs. I also tried to change registration criteria via TC "sdoe_dev_register" but it didn't help very much.

e.g. I checked two parameters as obligatory for registration: USER and PHYSICAL_ID and sent my request as follows

<?xml version="1.0" encoding="UTF-8" ?>

<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">

<asx:values>

<registration>

<param name="PHYSICAL_ID" value="68F24C2FF4EBFF6C649C84174BE68FBE" />

<param name="RGSTRATN_CNF_ID" value="000C29DEFEEE02DDA6E69FA499A3D0EA" />

<param name="NAME" value="HARZER" />

</registration>

</asx:values>

</asx:abap>

The function module returned as follows:

DEVICE_ID <empty>

EV_X_XMLDOC <empty>

REGISTERED "X"

No exeption has been thrown.

Does anybody know any detailed documenation about S_MMW_ADM package or even about the devices' registration process on the application server?

best,

Maciej

Former Member
0 Kudos

please create a new thread so that everyone will answer your question

0 Kudos

Hi Joseph,

Arjun is right that the RGSTRATN_CNF_ID refers to the CONFIGURATION_ID field in the table 'SMMW_DEV_REGISTR' but it is used only in case of MassDevice Setup.

Actually device registration generally happens in 2 sync. In the first sysnc it checks if the RGSTRATN_CNF_ID is already passed by the client or not. If not all the device registration parameters are sent back to the client, the client is supposed to fill all the registration paramater value and sync again to register the device.

In case of MassDevice Setup, since the client already have the list of all registration parameters and RGSTRATN_CNF_ID the device syncs with all the registration parameter values and CNF_ID and the registration happens in one sync only.

In your case if you want the list of all registration parameters to be provided by server in first sync don't provide the RGSTRATN_CNF_ID, the server shall send you the list of all registration parameters in an XML. Then in the next sync you fill the correct parameter value to register the device.

Regards,

Ravi

Former Member
0 Kudos

hi arjun/ravi,

so if i know the deviec registration parameter and the config id, i can call the register_device api once instead of calling it twice.

thanks and regards,

joseph beevin.

Former Member
0 Kudos

Yes, you can call it once if you know the parameters.

Former Member
0 Kudos

By the way, here is an example of the kind of XML response you get if you do not give the configuration ID:


<?xml version="1.0" encoding="utf-8" ?> 
- <registrationresponse>
- <configuration id="00145E5B145C02DDA698B76950DE472F">
  <reg_attribute name="ATTRIBUTE" default="TEST" mandatory="" read_only="X" /> 
  <reg_attribute name="DEVICE_TYPE" default="" mandatory="X" read_only="" /> 
  <reg_attribute name="NAME" default="" mandatory="X" read_only="" /> 
  </configuration>
  </registrationresponse>

So for the above response, in the second call, you should be returning the configuration ID along with the DEVICE_TYPE, and NAME (since the DOE is telling you that they are mandatory).

Former Member
0 Kudos

Hi arjun,

i have passed the XML as you gave in the above format,

if the logical device is present in the response the export parameter registered is X and in the XML i am getting a device id.

if the logical device is not in the DOE the export parameter registered is X and in the XML i am not getting any values in the device id node. it is empty.

and if i try to register a device which is already registered export parameter registered is X and i am not getting any values in the device id node. it is empty.

and it is not returning any error messages if it is already registered or if the device is not found. is there any way to determine this.

Thanks and regards,

joseph beevin.

Former Member
0 Kudos

The XML I pasted above is the response that the DOE will give to the device if you do not pass configuration_id. I just wanted to show the XML response that Ravi mentioned.

It is not what device should be sending to DOE For registration.

This is probably why you're getting weird behavior from the DOE.

For registration, the device must send an XML in the format given in section 5.1 of the document that I gave a link to in my first post.

Edited by: Arjun Shankar on Nov 30, 2009 11:22 AM

Former Member
0 Kudos

hi arjun,

i am sending the xml in the below format as mentioned in the custom client document

<?xml version="1.0" encoding="utf-8" ?>
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values><registration>
<param name="PHYSICAL_ID" value="' physical_id '"/>
<param name="RGSTRATN_CNF_ID" value="' config_id '"/>
<param name="NAME" value="' device_name '"/>
<param name="LOGIN_NAME" value="' user_name '"/>
</registration>
</asx:values>
</asx:abap>

Thanks and Regards,

Joseph Beevin.

Edited by: Joseph Beevin S on Nov 30, 2009 11:38 AM

Former Member
0 Kudos

I am not sure about how the response will look. I'll try this out in my free time and see how it is.

But the REGISTER_DEVICE API has an exporting parameter (not within the XML). Have you checked the value of this?

Here is how the document describes the DEVICE_ID parameter. "If registration is successful, then device id of the logical device is sent to the client via this parameter."

This probably means that if the field is blank, you can safely assume that the device has not got registered.

Former Member
0 Kudos

Hi Arjun,

if the registration is succesfull we are getting the device id.

but the issue is while un successfull registration. how to convey the cause of unsuccessfull registration to the user.

Is it due to device not available in DOE or the device which you trying to register is already registered in the DOE.

Is there any alternate way to get the cause of error.

there are 3 export parameter. i have the mentioned the value which i got while unsuccessfull registration.

DEVICE ID : <empty>

EV_X_XMLDOC : <xml content>

REGISTERED : X

Thanks and Regards,

Joseph Beevin.

Edited by: Joseph Beevin S on Nov 30, 2009 1:20 PM

Former Member
0 Kudos

Well, there are exceptions thrown by the API:

REGISTRATION_ERROR, ERROR_OTHERS, REG_CLNT_SERVER_CONFIG_DIFFER

These are explained in the document I linked to initially (i.e. the document explains which exception is thrown when).

There is no other way for the device to know what went wrong.

By the way: You did not mention if these exceptions are being thrown. If these exceptions are not being thrown as expected, then this is worth an OSS message. Also if you are getting REGISTERED = 'X' when in fact the registration is failing, this also looks like a bug to me (albeit a bug that can be lived with, since you can always know if it got registered based on the value of DEVICE_ID that is returned).

Former Member
0 Kudos

hi Arjun,

No error messages are returned by the API.

Thanks and Regards,

Joseph Beevin.

Former Member
0 Kudos

If the defined exceptions are not being thrown, then its worth raising an OSS message to report it.

Cheers!

Former Member
0 Kudos

Here is a nice document on writing a custom client:

[http://www.sdn.sap.com/irj/sdn/nw-mobile?rid=/library/uuid/30e033a0-73ef-2b10-b291-b653c3b48385]

Section 5.1 explains the API in detail.

Edited by: Arjun Shankar on Nov 30, 2009 8:40 AM

Former Member
0 Kudos

thanks arjun.

in the xml source we send there is one node called RGSTRATN_CNF_ID what is the need to give this value, the value is the configuration id from the table smmw_dev_registr.

can you please explain in detail the need and use of RGSTRATN_CNF_ID.

thanks and regards,

Joseph Beevin.

Former Member
0 Kudos

AFAIK, this refers to the CONFIGURATION_ID field in the table 'SMMW_DEV_REGISTR' in the DOE system.

i.e. When you set the registration parameters from SDOE_DEV_REGISTER transaction, they get stored in this table. The DOE generates a CONFIGURATION_ID (for the configuration that you store). You must pass the same.

Basically, you'll find several entries in this table for your registration configuration, all will have the same 'CONFIGURATION_ID' value. Just pass this in the device.