Skip to Content
avatar image
Former Member

SMP access to different projects with const app connection id

Hi, I want to get access to 2 different odata projects: prj1,prj2.

Each time I want to get access to only one of these odata projects.

Each project has constant connection id.

I need that in my app, when the user will choose a project, he will see the response of webservices of selected project.

How to write a function, that I will have access to selected project each time ?

This is my code of access to projects, but the code is working partially.

Regards,

John

factory.initnew = function (appisn)

{

if (appisn===0)

{

factory.asmxUrl="https://pmp.prj.com:8080/"; sUrl="https://pmp.prj.com:8080/odata/applications/latest/com.myprj.prj1/connections"; factory.oHeaders['X-SMP-APPCID']="fd81ff8e-0851-4c06-5586-b2d0c0b997ab";

}

else if (appisn===1)

{

factory.asmxUrl="https://pmp.prj.com:8080/"; sUrl="https://pmp.prj.com:8080/odata/applications/latest/com.myprj.prj2/connections"; factory.oHeaders['X-SMP-APPCID']="7b2a3e67-0e60-6766-18c1-dc6f3064434b";

}

oData.defaultHttpClient=sap.AuthProxy.generateODataHttpClient(); factory.clientCert=new sap.AuthProxy.CertificateFromStore();

if (1)

{

var request2 =

{

headers: factory.oHeaders,

certificatesource:factory.clientcert,

requestUri:sUrl,

data : factory.connectionData, method : "POST"

};

OData.request(request2,onSuccessForRegister2,onError);

}

};

}

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers