Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [om2m-dev] notification to another server (network application)

Hello,

Could you show me the subscription representation and the log ?
Thanks,

Mahdi

Le 25/06/2014 17:52, LIU Feifei a écrit :

Hello,

 

As Mr. Ben Alaya explained to me the class of notification :

 

public static ResponseConfirm notify(RequestIndication requestIndication, String contact){
        // Check whether the subscription contact is protocol-dependent or not.
        if(contact.matches(".*://.*")){
            // Contact = protocol-dependent -> direct notification using the rest client.
            requestIndication.setBase(contact);
            requestIndication.setTargetID("");
            return new RestClient().sendRequest(requestIndication);
        }else{
            // Contact = protocol-independent -> Check whether the targeted SCL is local or remote.
            String sclId = contact.split("/")[0];
            requestIndication.setTargetID(contact);
            if(Constants.SCL_ID.equals(sclId)){
                // scl = local -> perform request on the local scl.
                return new Router().doRequest(requestIndication);
            }else{
                // scl = remote -> retarget request to the remote scl.
               
return new Redirector().retarget(requestIndication);
            }
        }
    }


 

We tried our project with the first scenario :         if(contact.matches(".*://.*")).

 

A network application runs on a server and it is subscribed in another network application of the NSCL.

 

The returned notification request is good until the class RestHttpClient in the package “org.eclipse.om2m.comm.http”  processes the request. It returns a status code “400” with the result “ bad-request”.

 

We have met the right notification address as the contact but we can’t get the right result. Could you help me to resolve this problem?

 

 

Best Regards,

LIU Feifei

#
" Ce courriel et les documents qui lui sont joints peuvent contenir des
informations confidentielles ou ayant un caractè privéS'ils ne vous sont
pas destiné nous vous signalons qu'il est strictement interdit de les
divulguer, de les reproduire ou d'en utiliser de quelque maniè que ce
soit le contenu. Si ce message vous a é transmis par erreur, merci d'en
informer l'expéteur et de supprimer imméatement de votre systè
informatique ce courriel ainsi que tous les documents qui y sont attaché"


                               ******

" This e-mail and any attached documents may contain confidential or
proprietary information. If you are not the intended recipient, you are
notified that any dissemination, copying of this e-mail and any attachments
thereto or use of their contents by any means whatsoever is strictly
prohibited. If you have received this e-mail in error, please advise the
sender immediately and delete this e-mail and all attached documents
from your computer system."
#


_______________________________________________
om2m-dev mailing list
om2m-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/om2m-dev


Back to the top