Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3180

Javascript ajax call to SAP PI

$
0
0

Hi,

 

I need to build an interface to SAP (housed on our company network) from a cloud platform. SAP PI version 7.4 is installed in our landscape and is our preferred way to interface with SAP. My intent is to make a cross domain JQuery / Ajax call to PI.

 

Although, there are lot of articles on how to make a cross domain call, but none specifies how exactly the call should be made and what all information one should pass in the Header of the post request in Ajax call and what should be the URL in post request.

Sometime back, i had made JQUERY / ajax call to SAP by using SAP mobile server on CRM and that had worked, but i am struggling here and literally clueless.

 

This is how my code looks. When i run this code, i see that the request reaches the server, but it gives and 401 unauthorized error OR 405 method not found in one case when i changed the URL.

 

I would really appreciate help.

 

/***code

 

jQuery.ajax({type: "POST",

  url: 'http://ipaddress:51000/XISOAPAdapter/MessageServlet?ximessage=true',

  contentType: "text/xml",

  dataType: "xml",

  data : soapMessage,

  enableLogging: true,

 

headers:

  {

  'Authorization': 'Basic ' + btoa('arteria:apollo22')

  },

 

  success: function (response)

  {

 

     alert ("success");

     console.log(response);

  },

    

  error: function (response)

  {

       alert ("error");

      console.log(response);

  }

});

 

****/

regards

dinesh Rampal


Viewing all articles
Browse latest Browse all 3180

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>