Note that there are some explanatory texts on larger screens.

plurals
  1. POcall to odata webservice returns 401 using jaydata.js
    primarykey
    data
    text
    <p>I make a call to an odata webservice using jaydata.js but it returns 401 Unauthorized.</p> <p>Even if browse to the service and authenticate first manually in a second browser tab, is still get 401 in the first tab.</p> <p>This is my code : </p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;script src="Scripts/datajs-1.0.3.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="Scripts/jquery-1.8.3.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="Scripts/jaydata.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="Scripts/DynamicsNav70.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="Scripts/jaydataproviders/oDataProvider.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script&gt; nav = new NAV.NAV({ name: 'oData', oDataServiceHost: 'http://XXX.cloudapp.net:7048/DynamicsNav70/OData', user: "XXX", password: "XXX" }); $(document).ready(function () { nav.Customers.forEach(function (customer) { var item = "&lt;li &gt;&lt;a href=#&gt;@name&lt;/a&gt;&lt;/li&gt;".replace("@name", customer.Name); $('#customers').append(item); }); }); &lt;/script&gt; &lt;title&gt;&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;h1&gt;Customers&lt;/h1&gt; &lt;ul id="customers"&gt;&lt;/ul&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>This is the info from by browser : </p> <pre><code>Request URL:http://XXX.cloudapp.net:7048/DynamicsNav70/OData/Customers Request Method:OPTIONS Status Code:401 Unauthorized Request Headersview source Accept:*/* Accept-Encoding:gzip,deflate,sdch Accept-Language:en,nl;q=0.8 Access-Control-Request-Headers:accept, maxdataserviceversion, origin, dataserviceversion Access-Control-Request-Method:GET Cache-Control:max-age=0 Connection:keep-alive Host:XXX.cloudapp.net:7048 Origin:http://localhost:50793 Referer:http://localhost:50793/jaydata.html User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36 Response Headersview source Content-Length:0 Date:Thu, 06 Jun 2013 14:43:12 GMT Server:Microsoft-HTTPAPI/2.0 WWW-Authenticate:Negotiate </code></pre> <p>I'm a total noob in this matter, so any advice for a solution or better understanding of the problem could be helpfull</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload