Skip to Content
0
Dec 01, 2015 at 12:38 PM

Registration for Gateway App using AJAX call

29 Views

Hi All,

I am trying to do registration of ,one of the Application added using SMP SP09.

It is added by creating new application in SMP and I am able to fetch data using Rest Client but when i am trying to register application using AJAX call in SAP UI5 i am getting error .

403:Forbidden


I am getting this error in SMP Log also.


#2.0#2015-12-01 12:26:41 PM#ERROR#Registration#403##Other#1448972801022001#7e9c45a8-f53b-463d-a62c-1c81a76c896a#com.test.getso#com.sap.mobile.platform.server.online.filter.application.AbstractSMPApplicationSettingsHandler:doInternalFilter########646#####403:Forbidden#

This is the gateway service added using new app in SMP.

AJAX Call :

var url="http://XXXX:8080/odata/applications/latest/com.test.getso/Connections";

var ls_data = " <?xml version='1.0' encoding='utf-8'?> " +

" <entry xmlns='http://www.w3.org/2005/Atom' xmlns:m='http://schemas.microsoft.com/ado/2007/08/dataservices/metadata' "+

" xmlns:d='http://schemas.microsoft.com/ado/2007/08/dataservices'> " +

" <content type='application/xml'> " +

" <m:properties> " +

" <d:DeviceType>Android</d:DeviceType> " +

" </m:properties> " +

" </content> </entry>"

jQuery.sap.require("sap.ui.model.odata.datajs");

$.ajax({

type:"POST",

data: ls_data,

contentType: 'application/xml',

dataType: 'json',

"X-SMP-APPCID": '',

crossDomain: true,

url:url,

headers: {

contentType: 'application/xml',

"X-SMP-APPCID": '',

//Authorization:'',

//"Access-Control-Allow-Credentials": "true"

},

success : function(json,status,request) {

alert(" Success");

},

error : function(jqXHR, textStatus, errorThrown) {

debugger;

alert(" error" + errorThrown);

}

});

Kindly suggest the correct process to register app in SMP.

Thanks in Advance

Regards

Vivek