How to submit multiple information in one request - having issues in passing data

Hello Everyone,
I tried creating a service that use Deep entity to post some data to SAP. That works well from test service option, but when i am trying to code from java script it is failing and getting" Http Request failed "
Following is the snippet i use for my testing to pass the data, is there anything wrong with my passing of parameters, please suggest.
var itemO = [{ID:24, Name:"xyz"}, {ID:45,Name:"tze"}];
var itemT = [{ID:24, Name:"xyz"}, {ID:45,Name:"tze"}];
var head = [{ID:24, Name1:"xyz", Name2:"abc"}];
var headerCont = [{Header:head, HeadItemT:itemT, HeadItemO:itemO}]
alert(requestUri);
var request = 
{ headers: {"X-Requested-With": "XMLHttpRequest", 
                "Accept": "application/atom+xml,application/atomsvc+xml,application/xml", 
                "Content-Type": "application/atom+xml", 
                "DataServiceVersion": "2.0" }, 
requestUri: requestUri, 
method: "POST", 
user: "user123", 
password: "welcome", 
data: headerCont }; 
// Send the request and define callback methods.
OData.read(
requestUri,
function (data) {
var html = "";
for (var i = 0; i < data.results.length; i++) {
alert("Hello" + data.results[i].ID;
document.getElementById("container").innerHTML = html;
function (err) {
alert("Error occurred " + err.message);

var request =
{ headers: {"X-Requested-With": "XMLHttpRequest",
                "Accept": "application/atom+xml,application/atomsvc+xml,application/xml",
                "Content-Type": "application/atom+xml",
                "DataServiceVersion": "2.0" },
requestUri: requestUri,
method: "POST",
user: "user123",
password: "welcome",
data: headerCont };
Is it not sufficient to post or am i missing something. Also i followed the above thread and
not sure i can use this in my native application as it is not SAP UI5 based.
oModel = new sap.ui.model.odata.ODataModel('<URL>');
what will be the way to get the model instance if it is javascript, is there any place where i can refer the documentation for Ajax.  Thank you for the feedback.

Similar Messages

  • How can I transfer information from one ipad to another?

    how can I transfer information from one ipad to another ?

    What kind of information? You can sync things like Contacts and Calendars by using iCloud. You can backup one iPad to iTunes on a computer and then sync the backup to the other iPad. You can configure your iTunes content and sync the same content to both iPads.
    It is based on what you want to do. Or are you looking for a way to send files from one iPad to another wirelessly? There are apps to do things like that, as well as cloud services, such as DropBox.

  • How to use multiple ipods on one account

    I have an Ipod classic and just bought my sons two nano's how do I use these on the same account without changing my account info?

    Take a look here:
    How to use multiple iPods with one computer
    Forum Tip: Since you're new here, you've probably not discovered the Search feature available on every Discussions page, but next time, it might save you time (and everyone else from having to answer the same question multiple times) if you search a couple of ways for a topic, both in the relevant forums, in the User Tips Library and in the Apple Knowledge Base before you post a question.
    Regards.

  • How to execute multiple queries in one stored procedure.

    Hi,
    I am Kumar,
    How to execute multiple queries in one stored procedure.
    here is the my requirements,
    1. get the max value from one table and sum of the that value.
    2. insert the values and also sum of the max value.
    using stored procedure
    I am using SQL server 2000 database.
    Please help me.
    Advance thanks
    by,
    Kumar

    This is not a java question and it is not even a problem: your only problem is
    1) lack of knowledge
    2) lack of interest to find a manual
    But you are going to have to change both by actually reading a book or a manual that explains the stored procedure language of SQL Server. It is the same as Sybase I think, so you could also look for a manual for that DBMS.

  • How can we assign more than one request group to a responsibility?

    Hi
    Can anyone tell me how we can assign more than one request group to a responsibility?
    Thanks
    SS

    Hi SS,
    Its not possible, rather you should create a combination of Requests/RequestSets and create a new Request Group.
    Regards,
    Kiran

  • How to print multiple copies on one page ?

    How to print multiple copies of one document on one page ?
    in coreldraw I used to make the document -for example a business card 5x9 - and when sending to print it automatically placed the number of cards that would fit in my A4 sheet.
    how do I make the same operation in Indesign.
    thanks

    Hi, Peter S.
    >I can see that as a shortcut to printing a page of different cards for multiple people, but to do a simple n-up of a single card it seems overly complex to me. What am I missing?
    * It's just an alternative to copy/paste and step/repeat.
    * For a one-time only use, perhaps it's a little more complex than necessary. But for any future needs, only the content of the data file needs to be changed, either by editing, or by pointing to a new data file. If different cards for multiple people becomes necessary, it's ready to go.
    Regards,
    Peter Gold
    KnowHow ProServices

  • How to scan multiple pages in one file

    I would like to know how to scan multiple pages into one file.  There is no add button that comes up.  I have a HP Officejet 8600 and a macbook pro.  Please help, this would really help me out.

    Open Preview and use its "Import From Scanner" option in the File menu. This will launch the scanning interface, which has some standard and basic scanning controls. If you choose "PDF" as the file format to save as, then you will see an option to scan all images to one file. When you do this, you will scan and edit them individually, but Preview will save them to the same file when saved.

  • HT4059 I'm trying to organize my PDFs in iBooks on my ipad2 and I can't figure out how to combine multiple PDFs into one. Any thoughts?

    I'm trying to organize my PDFs in iBooks on my ipad2 and can't figure out how to combine multiple PDFs into one. Any thoughts?

    I'm trying to organize my PDFs in iBooks on my ipad2 and can't figure out how to combine multiple PDFs into one. Any thoughts?

  • Hp printer f4488 HOW TO SCAN MULTIPLE SHEET IN ONE ATTACHMENT

    hp printer f4488 HOW TO SCAN MULTIPLE SHEET IN ONE ATTACHMENT Kindly suggest if any solution are their for above subject..

    Open Preview and use its "Import From Scanner" option in the File menu. This will launch the scanning interface, which has some standard and basic scanning controls. If you choose "PDF" as the file format to save as, then you will see an option to scan all images to one file. When you do this, you will scan and edit them individually, but Preview will save them to the same file when saved.

  • How do you transfer information from one iPhone to another, when you started a new account instead of restore

    I Had to start the iPhone as a new setup as the software on the new phone was not up to date. Now, how can I get this to sync with my old phone Icloud backup.

    Hello Jardinesau,
    If you are having issues transferring your data from your previous iPhone to your new iPhone via an iCloud backup, you may find the information and steps outlined in the following articles helpful:
    If you've already set up your device, you can reset it so that you can go through the iOS Setup Assistant again and restore from your backup. Tap Settings > General > Reset > Erase All Content and Settings. Do this only if you already have a backup.
    Transfer content from an iPhone, iPad, or iPod touch to a new device - Apple Support
    iCloud: Restore or set up your iOS device from iCloud
    Sincerely,
    - Brenden

  • Hello every one, am having issue with my itunes, for some reason or another my icon in the itunes doesnt change, its stuck on Songs, and will not let me get playlist or anything else. can any one tell me if that can be fixed

    hello every one, am having issue with my itunes, for some reason or another my icon in the itunes doesnt change, its stuck on Songs, and will not let me get playlist or anything else. can any one tell me if that can be fixed

    http://support.apple.com/kb/TS3694#error-1
    Error 1 or -1
    This may indicate a hardware issue with your device. Follow Troubleshooting security software issues, and restore your device on a different known-good computer. If the errors persist on another computer, the device may need service.

  • How to schedule webi report in bulk (multiple report in one request)

    hi,
    I am little bit new to BOXI. I have little bit work experience in Crystal X on scheduling which was used in one of our enterprise java application. We are exploring options in BOXI.
    Currently i am scheduling a report with following api
    infoStore.schedule (webiDocs);
    This will schedule one report instance.
    My question is
    Is there any way to schedule multiple instances of a same report in one request.
    Is there any way to schedule multiple instances of a different report in one request.
    If above things are possible please provide the apis for the same.
    thanks in advance
    Shreenidhi

    Scheduling multiple Webi reports in one command:
    infoStore.schedule takes 1 arhgument of type IInfoObjects which is a collection of InfoObject. IInfoObjects is retrieved by the query. So if you to retrieve all the Webi Docs you want to schedule , then with infoStore.schedule(WebiDocs), it will schedule them all in 1 shot. Scheduling Info properties for each Webi Docs should also be set. Please refer to the samples on scheduling at link below.
    https://boc.sdn.sap.com/node/3211
    Scheduling one Webi Doc multiple times in one command:
    I donu2019t think it can be done in one command. Do you want to schedule the object multiple times each time running it with different prompts? Or do you want it to be sent to different destination in each schedule? Otherwise you can schedule it once and then access the scheduled instance multiple times.
    I hope this helps.
    Regards
    Aasavari

  • How to get multiple phones in a request with SelectCmDevices

    Hi all:
    I had met this problem, i can get only one phone with this request:
    "<soapenv:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" " +
    "xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:soap=\"http://schemas.cisco.com/ast/soap/\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\"> " +
    "<soapenv:Header>" +
    "<AstHeader xsi:type=\"soap:AstHeader\">" +
    "<SessionId xsi:type=\"xsd:string\">1234567</SessionId>" +
    "</AstHeader>" + "</soapenv:Header>" + "<soapenv:Body>" +
    "<soap:SelectCmDevice soapenv:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">" +
    "<CmSelectionCriteria xsi:type=\"soap:CmSelectionCriteria\">" +
    "<SelectBy xsi:type=\"xsd:string\">Name</SelectBy>" +
    "<Status xsi:type=\"xsd:string\">Registered</Status>" +
    "<Class xsi:type=\"ns1:DeviceClass\">Phone</Class>" +
    "<Model xsi:type=\"xsd:unsignedInt\">255</Model>" +
    "<SelectItems>" + "<Item>" + macadd +
    "</Item>" + "</SelectItems>" + "</CmSelectionCriteria>" +
    "</soap:SelectCmDevice>" + "</soapenv:Body>" +
    "</soapenv:Envelope>";
    But how can i to get multiple phones in a request? i had tried many methods, but all of them are not work. Thanks for any helps!

    Hi msabir:
    Thanks for your help. Yea,i don't want to get the first 200 phones, i just want to get the phones which are listed in the items.For example:
    "SEP0013192F15DU"+
    "SEP000E839C1479"+
    "SEP00131A4D3B34"+
    "SEP001D450BF4CF"
    ,then i just want to get the four phones, but when i do like this,i always just got one phone,why is that? Then i changed to use Array like this:
    "http://schemas.xmlsoap.org/soap/encoding/\">" +
    "" +
    "" +
    ""+
    ""+
    "10"+
    "Phone" +
    "255" +
    "Any" +
    "Name" +
    "" +
    ""+
    ""+
    ""+
    ""+
    ""+
    "SEP001D450BF4CE"+
    ""+
    ""+
    "SEP00131A4D3B34"+
    ""+
    But it alway throws this error:
    soapenv:Server.generalExceptionERROR: SelectBy is null
    why? Thank you very much!

  • How to delete Multiple Artists in one action?

    Hi,
    I want to do a big clean up on an iTunes library with over 4000 albums.
    How can I delete multiple Artists in one action?
    It looks like I can only delete 1 Artist at a time, and then this action shoots me to the top of the list.  Which is a pain then having to scroll back down through such a huge list to then delete the others one at a time... each time being shot back to the top of the list.
    For example I have the following artists;
    The Alarm 01 – 1 song
    The Alarm 02 – 1 song
    The Alarm 03 – 1 song
    The Alarm 04 – 1 song
    The Alarm 05 – 1 song
    The Alarm 06 – 1 song
    And I want to delete them all in 1 action.
    Can this be done?  How best to do it?
    Thanks in advance,
    Dave

    You can't delete "artists" - just songs (or songs grouped into albums).  When iTunes displays the library or a playlist in Artists view it is doing so using the metadata values set in the relevant songs.  If you're looking at this view:
    then your selections in the left pane - the artists list - is filtering what you see on the right.  When you select Delete via the keyboard or via a right-click operation, you are initiating an operation to delete the songs by that artist.  To delete songs by more than one artist in a single operation you'll need to select and delete in Albums view:
    or in Songs view:
    where you can also use the Column Browser to filter songs by multiple artists:

  • How to associate multiple sites on one standard instance?

    I have multiple websites that I want to put on one Standard instance. When I click on the scale link for a given website - it doesn't give me the option to add other websites to the standard instance. It creates a new instance for each website which really
    racks up the billing charges. How do you put multiple websites on one standard instance?

    The sites were already created and were under the standard instance. I thought it was just running one instance until I saw the credit balance going down quick. When I checked the websites using the new portal - they are actually under 4 web hosting plans. 
    I changed them back to the free one. Now when I try to change the plan to standard for a website - only that website's plan is changed. The other do not. There is no option for me to put the others in the same instance.

Maybe you are looking for