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