How to set CSRF token  to make a POST call via Destinations in HANA XS

I have a requirement where I would want to make a POST call to Gateway Service,which would need a CSRF token.
I fetch the CSRF token and then I use the same token during POST.
Hence i set this in $.request.headers() .
I know that I have to set the cookie as well for CSRF so I set the headers as
req.headers.set("Cookie","'sap-XSRF_GIQ_100=TQRYJKzJSH8SknthcwRQFA%3d%3d20140425093233hxBe2w9qL9AjCtnh3gsIvPP6-IwsfZB2lqE5RtfGH8A%3d'")
But this fails with CSRF token validation
I found that the cookie value is not set in the service.
How are cookies handled in  Hana how can i set my csrf and XSRF-Token cookie value in the request
Thanks,

Here is example code where I do this very thing - get the CSRF token for an ABAP/Gateway service and use it in the request. The CSRF Token should be a header not a cookie.
var dest = $.net.http.readDestination("WileECoyoteABAP.services", "ZWILEECOYOTE_SRV");
  var client = new $.net.http.Client();
  //Get CSRF Token
  var CSRF = getCSRFToken(dest, client);
  //Make Request
  var req = new $.web.WebRequest($.net.http.POST, 'ACMEItemCollection/');
  req.headers.set("x-csrf-token",CSRF);
  req.headers.set("Content-Type","application/json");
  req.setBody('{"d": {"ItemId": "9999999999","Item": "'+Items.Details[0].ITEM+'"}}');
  client.request(req, dest);
  var response = client.getResponse();
function getCSRFToken(dest, client){
  var req = new $.web.WebRequest($.net.http.GET, 'ACMEItemCollection/?$top=1&$format=json');
  req.headers.set("x-csrf-token", "fetch");
  client.request(req, dest);
  var response = client.getResponse();
  var CSRF = response.headers.get("x-csrf-token");
  if(response.status===200){}
  else{
  handleErrors(response);
  return CSRF;

Similar Messages

  • N8; How to set up SIP and make (WiFI & 3G)VOIP cal...

    N8 only comes with SIP software and you need to download the the VoIP setting software at this link (use VoIP 3.1):
    http://www.forum.nokia.com/info/sw.nokia.com/id/d476061e-90ca-42e9-b3ea-1a852f3808ec/SIP_VoIP_Settin... 
    You can use the N8 web browser and load directly from the site to the phone.
    then go to:
    Menu>settings>connectivity>Admin.Settings>SIP settings
    option>New SIP Profile>use default profile.
    This window needs to be configured with your VoIP provider setting which may be found on their site or just do a search. I used the settings from my previous phone. I have Gizmo VoIP and will be using the setting for this service as an example to set up Wifi and 3G SIP setting
    Profile Name> Gizmo, (assign the name of your provider e.g.. Gizmo, Google talk, etc)
    Service profile> IETF
    Default Destination> WiFi
    Public username: sip:[email protected] (Input your VoIP provider info)
    Use compression> No
    Registration> When needed
    Use security> No
    Then goto Proxy server:
    Proxy server address> siproxy01.sipphone.com (use your provider proxy address setting)
    Realm> proxy01.sipphone.com (use your provider setting)
    Username> (use your username)
    Password> (enter your password0
    Allow loose routing> Yes
    Transport type> UDP
    Port> 5060
    Go back and then go to Registrar server:
    Registrar server address> siproxy01.sipphone.com (use your provider Registrar setting)
    Real> proxy01.sipphone.com (use your provider setting)
    Username> (use your username)
    Password> (enter password)
    Transport type> UDP
    Port> 5060
    Again folks above is just an example. You must use your provider settings.
    Then when you are done go back to:
     Admin setting> Net setting>Advance VoIP setting>Create new service> choose the SIP profile shown, e.g.  Gizmo 
    This will configure the VoIP setting with the particular SIP profile. It will also add a SIP Tel profile Pane in your Contacts folder, Internet call option to the contacts list and Phone log.
    Now go to the SIP pane in Contacts folder, sign in and then make a test call . To make a SIP call just go to a contact and choose Internet call. If you configured everything correctly, it should work and you are done.
    For 3G connection, follow above direction and create new SIP profile with new name (e.g. Gizmo (3G). All settings are same except:
    Default destination>Internet
    Then set up the VoIP setting with the new SIP profile by going to:
    Admin setting>Net setting>Advance VoIP settings>Create new service> Choose the SIP profile you just configured e.g. Gizmo (3G)
    Then:
    Admin setting>Net setting>Advance VoIP settings>VoIP service>choose the 3G SIP profile, e.g. Gizmo (3G)>Profile setting>>>>>
    Go down to AWCDMA> set it to "on"
    Exit out of everything. Go to SIP (3G) pane in the Contacts folder. Sign in and make test call.
    I have configured many Mobile phones and found the N8 somewhat touchy. But, the sound quality on Gizmo VoIP using both WiFi and 3G was great, no echo or any problems.
    Useful hints:
    If it does not connect or make a call, you need to check the SIP setting for any error. If you find any problem there, you must first remove the SIP profile in the Net setting. Then go to the SIP setting and correct the problem. Double check everyting, go back to Net setting>Advance VoIP setting>Create new service and add the SIP profile. The reason is that when you Configure a VoIP setting with a SIP profile, the SIP info is permanently loaded and will not change even if you make any change in the SIP profile. So any time you change anything in the SIP profile (even the password) you always need to remove, make correction and then reload the corrected SIP profile to the VoIP setting.
    There are also few Mobile service providers who have blocked VoIP on their data network service. So, just check with your service provider. In US both AT&T and TMobile have open network for VoIP.

    Hi
    I have an unbranded N8 and am trying to get VoipCheap to work.
    I have tried to set up VOIP but still facing a problem or 2 so please assist me.
    I have an active account via VoipCheap.com with a profile name and password and it is verified.
    1/ When I look in Admin Settings / Sip Settings it shows VoipCheap with "not registered" under it..why?
    My settings when I click on VoipCheap are:
    profile name: VoipCheap
    Service profile: IETF
    Default destination: Internet
    Public username: sip:[email protected]
    Use compression: No
    Registration: When needed
    Use security: No
    Proxy server address: sip:sip.VoipCheap.com
    Realm: VoipCheap.com
    Username: [email protected]
    Password:  ****** (I have entered my password)
    Allow loose routing: Yes
    Transport type: UDP
    Port: 5060
    Registrar server settings same as Proxy server settings.
    I have also gone to Net settings / VoipCheap settings and see:
    Username:  sip:[email protected]
    Password: ***** (I have entered my password)
    Default service: No
    Service connectivity: Internet
    In Contacts I have a VoipCheap tab with the icon for internet calling and it says
    Sign in (example)
    but when I click on this it shows connecting (via my internet connection) but hangs there - it does not seem to connect............
    what do you think I am doing wrong, please ????????????????

  • How to send te XML data using HTTPS post call & receiving response in ML

    ur present design does the HTTP post for XML data using PL/SQL stored procedure call to a Java program embedded in Oracle database as Oracle Java Stored procedure. The limitation with this is that we are able to do HTTP post; but with HTTPS post; we are not able to achieve because of certificates are not installed on Oracle database.
    we fiond that the certificates need to be installed on Oracle apps server; not on database server. As we have to go ultimately with HTTPS post in Production environment; we are planning to shift this part of program(sending XML through HTTPS post call & receiving response in middle layer-Apps server in this case).
    how i can do this plz give some solution

    If you can make the source app to an HTTP Post to the Oracle XML DB repository, and POST contains a schema based XML document you can use a trigger on the default table to validate the XML that is posted. The return message would need to be managed using a database trigger. You could raise an HTTP error which the source App would trap....

  • Using Outlook to make a phone call via lync

    I have Outlook 2010 and Lync 2010 clients installed on a workstation, with full VoIP for Lync for external and internal calls.
    I want to know if its possible to have Outlook place a voice call via lync automatically based on a rule or via custom VBA in outlook?  Is it possible to do the same but send SMS instead of a voice call?
    It seems possible as the tools integrate quite well, but I haven't found any documentation supporting it yet.

    You can call a phone contact in outlook, then it will open a Lync Window.
    But not sure if a rule or custom VBA can make it automatically.
    You may consultant the outlook expert.
    Lisa Zheng
    TechNet Community Support

  • Cannot make a video call via Skype WiFi?

    I am trying to make a video call and having trouble doing it. I have signed in and added Skype WIFI to my account but I still cannot make a call. It keeps telling me that I need Skype Credit when it should be free. Can youhelp me with this problem?
    Post transferred to create new topic; subject/title edited accordingly.

    From the Messages menu bar, select
    Video ▹ Connection Doctor
    In the window that opens, select
    Show: Capabilities
    There should be a checkmark on the line with the words "1-on-1 video chat." Select
    Show: Network Status
    You should have two green dots.
    Make sure that you and the other party meet the applicable requirements shown in these support articles:
    Share your screen
    Requirements for audio chats, video chats, and screen sharing
    See also:
    Fix video chat issues

  • How to set the classpath to make the jsp connect to the ejb

              i make a entity ejb jar file, and put it under the applications directory. using
              a client class program test, it work ok. but when i run it from jsp, the browser
              said cannot resolve the ejb's remote and home interface.
              how can i make the jsp know where the interface is? thanks
              by the way, the weblogic server i used is wlserver6.1
              

    You will have to create the servlet mapping in the Web.xml file
    <servlet>
                 <servlet-name>FirstServlet</servlet-name>
                 <servlet-class>FirstServlet</servlet-class>
        </servlet>
    <servlet-mapping>
            <servlet-name>FirstServlet</servlet-name>
            <url-pattern>/servlet/FirstServlet</url-pattern>
        </servlet-mapping>

  • Sun IdM: How to set a multi-value field on document.mainform via javascript

    The following will set variables.variable1 to variables.variable2 when the "Script Link" component is clicked. I would like to modify
    this so that el2 references a multi-valued element (e.g. a list generated by a Select Field)
    <Field>
    <Display class='Javascript'>
    <String>
    function myScript() {
    el=getElement(document.mainform,"variables.variable1");
    el2=getElement(document.mainform,"variables.variable2");
    el.value=el2.value;
    </String>
    </Display>
    </Field>
    <Field name='Script Link'>
    <Display class='Link'>
    <Property name='URL'>
    <String>javascript:myScript();submitCommand(document.mainform,%20'Recalculate');</String>
    </Property>
    </Display>
    </Field>
    My issue is, if variables.variable2 is a list / multivalued, i get errors trying to traverse through the "array".
    How can i read and set a list element via the javascript function above? I've tried things like get(), put() , as well
    as path expressions like variables.variable2[0] .
    any help would be appreciated....
    is there an API somewhere i can reference?

    The MultiSelect field-type is a little different than the rest of the fields. If you use the applet version, then selecting/deselecting values cannot be captured by referencing the field directly in javascript.
    The way to identify the selections is to use the javascript methods includes/MultiSelect.js file (IDM form submission uses the same method):
    fixMultiSelectAppletBeforeSubmit( )
    fixMultiSelectNonAppletBeforeSubmit( )
    .. and then referencing the "<multiselect-field>_selected" form element.
    So in your case, the code should look something like this:
    function myScript() {
        fixMultiSelectAppletBeforeSubmit(document.mainform,"variables.variable1");
        var el1 = getElement(document.mainform,"variables.variable1_selected");
        // assign the value to variable2..
        el2 = getElement(document.mainform,"variables.variable2");
        el2.value = el1.value;
    }Just make sure ":variables.variable2" is not a multi-select field, else the value set here will be reset during form submission.
    Adi
    [www.xpressutils.com|http://www.xpressutils.com]

  • How to set custom page heading in List when called  from Screen

    Hi All,
    I have a requirement in which i have to call a list from screen. On the list i have to display data on from screen. The data width is 200(around 15 columns).
    In the screen's PBO i have used the below code to navigate to list:
    LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.
      SET PF-STATUS space.
      SUPPRESS DIALOG.
    But, here how can i set the custom LINE-SIZE and LINE-COUNT.
    Please do reply  with an example.
    Thanks in advance,
    Sumesh

    Hi,
    Use the below code.
      data : lo_column_setting type ref to if_salv_wd_column_settings,
             LO_COLUMN TYPE REF TO CL_SALV_WD_COLUMN,
              LO_HEADER TYPE ref to cl_salv_wd_column_header.
    lo_column = lo_column_setting->get_column( 'USERID' ).
      CALL METHOD lo_column->CREATE_HEADER
      RECEIVING
        VALUE  = LO_HEADER.
      CALL METHOD LO_HEADER->SET_TEXT
      EXPORTING
        VALUE  = 'User Id'.
    Regards,
    Priya

  • How to set infinite read timeout on web service call

    For JAX-WS JRF web services, I have a client that can set oracle.webservices.ClientConstants.HTTP_READ_TIMEOUT to any given value. I know that if you don't set this value, the default value is infinite. But how do I explicitly set the timeout to be infinite? Maybe 0? I will get something set up that I can experiment with, but someone might know off the top of their head. Thanks.

    Have found out that 0 is the default, which is infinite timeout.

  • How to set IPC JCO user  connect to CRM system via 'group'?

    Dear expert,
    When we do XCM setting for IPC JCO connect, we input the server address directly in 'ashost',  such as ashost = dga107.ndpaper.com. However, for CRM server, we have two instance, 107 and 108. Does that mean JCO user will only logon instance 107? Does that mean order will only creat in 107, no order in 108?  can we have do some some settings to enable a group logon for the JCO user?
    i noticed for base config, there is 'group connect' in dropdown list,how can i config XCM in the group way? is there any instruction?
    Thanks~
    Hedy
    Edited by: Ye Zhang on Nov 3, 2011 4:27 AM

    Hi Ying
    I'm pretty sure there is a way but I can't check it right now.
    We have such systems where this is set the way you would like it to be, but those are connected to a CUA (central user administration) so the possibility
    does exist for regular Dialog users.
    Unless it is valid for all users in the systems (which is very likely) that way only admin's in the CUA have authorization to change the password and synchronize it.
    Service users is indeed what you are looking and most likely the best solution.
    Kind regards
    Tom
    Edited by: Tom on Feb 1, 2008 10:35 AM

  • How to stop a threads that makes I/O calls ?

    Hi,
    I've a business method that calls a Stored Procedure and makes lots of calculations. This method works inside its own thread, because I do not want to stop the GUI from accepting user actions.
    My problem is : this method may take from 5 minutes to 1 hour to process, depending on the size of the input. Sometimes, for any reason at all, the user may want to stop this execution (pressing a button on the GUI). How can I safely stop the thread ?
    I know I should not use stop() and suspend() because they are deprecated. And I do not use loops (remember it calls only a StoredProcedure that makes all processing), so I cannot use a variable nor interrupt(), because they do not work.
    Do you know any other way to stop this thread's execution ? By the way destroy() is not implemented.
    Thanks and regards.
    Bruno

    Are you saying that the 5 minutes to an hour is all spent in the stored procedure?
    If so the only real solution is to kill the statement - I'm not sure how the DB will handle that, but it will certainly free up your cycles.
    To do that without violating encapsulation, you just need to keep a reference to an object that knows something about the DB connection - you don't have to actually pass around the JDBC objects.
    Consider an object like this:
    public class DoLongProcedure {
       private Statement dbStatement;
       public double doLongCalculation() {
          dbStatement.execute(...);
          // etc
       public void interruptCalculation() {
          dbStatement.close();
    }You create an instance of this object and call its doLongCalculation() method to start everything. You have a reference to this object somewhere, because you are waiting for a response. When the user wants to cancel the process you just call the interruptCalculation() method.
    You have not violated your separation of functionality - if you find a new way to stop the process without killing the statement later, you just reimplement that method.

  • How to set busy trigger and max number of calls for a sip phone in SRST

    How is it possible to set the maximum number of calls and busy trigger for a line on a sip phone in SRST .There is no commands like dual-line or octo-line for the max-dn like under call-manager-fallback .
    Sent from Cisco Technical Support iPad App

    So is the answer then that there is no way for a SIP phone in SRST mode to handle multiple calls? I have a site currently failed over in SRST mode, and I have noticed that the reception phone can only handle one call at a time. If I place a second call to it I get a busy signal.

  • How to make a transaction call via https protocol

    Hi,
    Recently we have got a new requirement that requires the protocol to be used for a particular transaction as https.
    Is there any way that we can use https for only few transactions instead of all the transactions on MII (12.x)?
    For Example :
    Instead of
    http://<servername>>/XMII/Runner?Transaction=<transactionpath>
    We want to make call as
    https://<servername>>/XMII/Runner?Transaction=<transactionpath>
    Thanks in Advance
    Amit

    Amit,
    Since this is a NetWeaver setting to use https, it is either all or nothing for MII.  So if you have https turned on all of your MII Runner calls will need to use https and vice versa.  You are not able to pick and choose.
    Also to note if you are on MII 12.1 a new Service Pack (SP8) for MII is coming out soon, most likely by the end of the year.  This service pack takes advantage of the new security features (including https) that have been added in NetWeaver EHP1 SP5 or greater.  I would highly recommend moving to this if you are using https.  I'm not sure of all the pros but a SAP Note will be delivered with this release explaining in more detail.
    Thanks,
    Erik

  • How to set the properties of plots in XY graph via VI Scripting

    Hi,
    Is there any way out to change the properties of XY graph plots through VI Scripting? 
    From main VI, I create an XY graph in another VI through VI scripting. I now want to change the Plot legend names, and their styles etc. I notice that these properties can be set up in the new VI (See screen shot Graph Property Node in NEW VI.jpg). However, I couldn't see these properties by calling the property node of XY graph reference in main VI (see screen shot ).
    Thanks for the due response.
    Regards
    HB
    Solved!
    Go to Solution.
    Attachments:
    Graph Property Node in NEW VI.jpg ‏1527 KB
    Graph properties in main VI.jpg ‏959 KB

    Hello HB,
    I see plot.names when I scroll down a bit further. No scripting required.
    Hope this helps.
    Uli
    Attachments:
    plot.names.png ‏74 KB

  • How to set Command Timeout in Crystal report while calling from C# code

    I am using Crystal report XI R2.  I am calling SQL server 2005 stored procedure as source in the report. I want the report should timeout from the website if the stored procedure doesn't return resultset after 5 minute. Could you please assist how should I chnage the below code to achieve that.
    Code :
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using CrystalDecisions.CrystalReports.Design;
    using CrystalDecisions.Shared;
    using CrystalDecisions.Web;
    using CrystalDecisions.CrystalReports.Engine;
    namespace CrystalTest
        public partial class _Default : System.Web.UI.Page
            protected ReportDocument rd;
            protected CrystalReportViewer Crv;
            protected void Page_Load(object sender, EventArgs e)
                rd = new ReportDocument();
                rd.Load(Request.MapPath("FXRate.rpt"));
                SetDBLogonForReport(GetCrvConnectionInfo(), rd);
                ParameterFields crtParamFields;
                ParameterDiscreteValue crtParamDiscreteValue1;
                ParameterField crtParamField1;
                ParameterDiscreteValue crtParamDiscreteValue2;
                ParameterField crtParamField2;
                ParameterDiscreteValue crtParamDiscreteValue3;
                ParameterField crtParamField3;
                ParameterDiscreteValue crtParamDiscreteValue4;
                ParameterField crtParamField4;
                ParameterDiscreteValue crtParamDiscreteValue5;
                ParameterField crtParamField5;
                ParameterDiscreteValue crtParamDiscreteValue6;
                ParameterField crtParamField6;
                crtParamFields = new ParameterFields();
                crtParamDiscreteValue1 = new ParameterDiscreteValue();
                crtParamField1 = new ParameterField();
                crtParamDiscreteValue1.Value = "USD";
                crtParamField1.ParameterFieldName = "@BaseCurrCode";
                crtParamField1.CurrentValues.Add(crtParamDiscreteValue1);
                crtParamFields.Add(crtParamField1);
                crtParamDiscreteValue2 = new ParameterDiscreteValue();
                crtParamField2 = new ParameterField();
                crtParamDiscreteValue2.Value = "EUR";
                crtParamField2.ParameterFieldName = "@CounterCurrCode";
                crtParamField2.CurrentValues.Add(crtParamDiscreteValue2);
                crtParamFields.Add(crtParamField2);
                crtParamDiscreteValue3 = new ParameterDiscreteValue();
                crtParamField3 = new ParameterField();
                crtParamDiscreteValue3.Value = "2008-05-28 00:00:00";
                crtParamField3.ParameterFieldName = "@FromDate";
                crtParamField3.CurrentValues.Add(crtParamDiscreteValue3);
                crtParamFields.Add(crtParamField3);
                crtParamDiscreteValue4 = new ParameterDiscreteValue();
                crtParamField4 = new ParameterField();
                crtParamDiscreteValue4.Value = "2008-05-28 00:00:00";
                crtParamField4.ParameterFieldName = "@ToDate";
                crtParamField4.CurrentValues.Add(crtParamDiscreteValue4);
                crtParamFields.Add(crtParamField4);
                crtParamDiscreteValue5 = new ParameterDiscreteValue();
                crtParamField5 = new ParameterField();
                crtParamDiscreteValue5.Value = "ashok12";
                crtParamField5.ParameterFieldName = "@CurrentUser";
                crtParamField5.CurrentValues.Add(crtParamDiscreteValue5);
                crtParamFields.Add(crtParamField5);
                crtParamDiscreteValue6 = new ParameterDiscreteValue();
                crtParamField6 = new ParameterField();
                crtParamDiscreteValue6.Value = DateTime.Now.ToString("dd MMM yyyy hh:mm");
                crtParamField6.ParameterFieldName = "@ClientTime";
                crtParamField6.CurrentValues.Add(crtParamDiscreteValue6);
                crtParamFields.Add(crtParamField6);
                Crv.ParameterFieldInfo = crtParamFields;
                Crv.DisplayGroupTree = false;
                Crv.BestFitPage = true;
                Crv.ReportSource = rd;
            private void SetDBLogonForReport(ConnectionInfo connectionInfo, ReportDocument reportDocument)
                Tables tables = reportDocument.Database.Tables;
                foreach (CrystalDecisions.CrystalReports.Engine.Table table in tables)
                    TableLogOnInfo tableLogonInfo = table.LogOnInfo;
                    tableLogonInfo.ConnectionInfo = connectionInfo;
                    table.ApplyLogOnInfo(tableLogonInfo);
            public static CrystalDecisions.Shared.ConnectionInfo GetCrvConnectionInfo()
                CrystalDecisions.Shared.ConnectionInfo con = new CrystalDecisions.Shared.ConnectionInfo();
                con.ServerName = System.Configuration.ConfigurationSettings.AppSettings["conServer"].ToString();
                con.DatabaseName = System.Configuration.ConfigurationSettings.AppSettings["conDatabase"].ToString();
                con.UserID = System.Configuration.ConfigurationSettings.AppSettings["sesUser"].ToString();
                con.Password = System.Configuration.ConfigurationSettings.AppSettings["sesPwd"].ToString();
                return con;
            private void Page_Unload(object sender, System.EventArgs e)
                if (rd != null)
                    rd.Close();
                    rd.Dispose();
                if (Crv != null)
                    Crv.HasCrystalLogo = false;
                    Crv.Dispose();

    Yes it is possible to use datasets. resources listed below. One hting to be aware of; Using datasets larger than about 5,000 records (depending on the report) is not advisable. Performance will potentially be an issue with datasets that are too large.
    Crystal Reports Guide To ADO.NET
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/401c4455-a31d-2b10-ae96-fa57af5aec20
    Reporting Off ADO.NET Datasets
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2091d0c3-da1d-2b10-22be-a3426b183f75
    VS2005_Walkthroughs
    http://www.businessobjects.com/global/pdf/dev_zone/VS2005_Walkthroughs.pdf
    VB samples:
    https://smpdl.sap-ag.de/~sapidp/012002523100006252822008E/net_win_smpl.exe
    In the above samples see VBNET_WIN_ADODOTNET
    C# samples
    https://smpdl.sap-ag.de/~sapidp/012002523100006252722008E/csharp_win_smpl.exe
    BTW., notes databse is here:
    https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_ossnotes&query=&adv=true
    Articles can be searched here;
    https://www.sdn.sap.com/irj/sdn/businessobjects-articles
    Ludek
    Edited by: Ludek Uher on Feb 17, 2009 1:22 PM

Maybe you are looking for