cancel
Showing results for 
Search instead for 
Did you mean: 

SAPHANA:Unable to expose store procedure via ServerSide

Former Member
0 Kudos

Hi Experts

I am a beginner to server side java script(XSJS).                                     

I am trying to expose the .xsjs, file data containing StoreProcedure and access through web browser with the following url containing hostname,portnumber and package path as shown below:

"hostname:80<instance#>/testdemo/Demodata.xsjs"

and i am getting the following error when i am trying to access it.  

"This link seems to be broken

We could not find the resource you're trying to access.

It might be misspelled or currently unavailable"

I have created the following files in Project Explorer:

1.An Empty File with file extension .xsapp

2.A file with extension .xsaccess: 

            {

            "exposed":true,

            "authentication":[{"method":"LogonTicket"},{"method":"Basic"}]

            }

3.A file with file name Demodata.xsjs:

     $.response.contentType = "text/html";

     var body = ''; 

     var conn = $.db.getConnection(); 

     var cst = conn.prepareCall('{CALL testdemo.TESTPROCEDURE(?,?)}');  

     if (cst.execute()) { 

     body = 'Ok'  + cst.getInteger(3); 

     }

     else

     { 

     body = 'Failed'; 

     } 

    cst.close();

    conn.commit();

    conn.close();

4.A Store procedure with name TEST_PROCEDURE in SQL console:

create procedure testdemo.TEST_PROCEDURE LANGUAGE SQL SCRIPT AS "TEST"

/********* Begin Procedure Script ************/

BEGIN

SELECT

           cStyID,

           cName,

           cDimension,

           cSea,

           cDes,

           cMCCod,

           cBrand,

     Avgpr,

           cFil,

           cCom,

           cWhs,

           cUse,

           dtDa,

           dtDat,

           Art,

           STyp,

           SVal,

           CreatBy,

           Crea,

           ModiBy,

           ModiDt,

           Log

FROM tblArticl;

END;

/********* End Procedure Script ************/

The procedure gets executed well and the result value is OK.

Below are the views:

Project Explorer View Below:

      

RepositoryViewBelow:

       

NavigatorViewBelow:

All the above files are committed and activated succesfully.But an error occured when I tried to access "hostname:80<instance#>/testdemo/Demodata.xsjs" it in browser.

What could be wrong here?

Any sample examples would be appreciated.

Thanks for your time

Koushik.

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

What happens when you just try to load http://hostname:80<instance#>/ in your browser?  Do you get the XS Engine Welcome screen?

Former Member
0 Kudos

Hi Thomas

Thanks for your reply .

The local host is running perfectly.But when i am trying to execute the stored procedure via server side Java Script i am getting the error "This link seems to be broken".

what is wrong in my code?

Is it possible to expose the stored procedure via xsjs? If so please provide a sample example.

Thanks for your time.

Answers (0)