Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery ajax method calling web service receiving 403 forbidden
    primarykey
    data
    text
    <p>I have a html page with the following ajax method:</p> <pre><code>$(document).ready(function() { $.ajax({ type: "POST", url: "http://www.webservice.com/blahblah.asmx/blahb123", data: "tnWsGuid=TEST1", dataType: "json", contentType: "application/json; charset=utf-8", success: function(msg) { alert("sucess") }, error: function(e) { alert(JSON.stringify(e)); } }); }); </code></pre> <p>Which is returning to me 403 forbidden. A fellow co-worker built the web service and I do not have access to the code nor do I have the current ability to change it as he is on vacation. I need to display this data - at this point everything I try is failing and giving me a 403 forbidden error. I have changed the url name and the success function to just a alert dialog for the purpose of displaying the code.</p> <p>One other thing is that the json is wrapped in XML it seems, coming from a ASP.NET webservice which looks like this:</p> <pre><code>&lt;string xmlns="http://Walkthrough/XmlWebServices/"&gt; {"approverName":"","emailAddress":"","companyName":"ABC","address":{"streetAddress1":"12 BlahBlah","streetAddress2":"","state":"ON","zipCode":"","country":"SO","phoneNumber":""},"tabledata:"[{"vendorPart":"AAAAA","partDescription":"N/A","price":"0.00","quantity":"28"},{"vendorPart":"BBBBBBB","partDescription":"N/A","price":"0.00","quantity":"3"},{"vendorPart":"CCCCCC","partDescription":"N/A","price":"0.00","quantity":"25"}]} &lt;/string&gt; </code></pre> <p>This was not the intention originally as I had expected to receive json however I can't do anything about it now and must deal with it in XML and just try and turn the json formatted inside into a json object.</p> <p>I have tried as the following too:</p> <pre><code>$(document).ready(function() { $.ajax({ type: "GET", url: "http://www.webservice.com/blahblah.asmx/blahb123", data: "tnWsGuid=TEST1", dataType: "xml", contentType: "text/xml", success: function(msg) { alert("sucess") }, error: function(e) { alert(JSON.stringify(e)); } }); }); </code></pre> <p>Finally I will output the Firebug response from FireFox here for both examples I've tried (json/xml)</p> <p>Json: <a href="http://i.imgur.com/zJy4BvD.jpg" rel="nofollow">http://i.imgur.com/zJy4BvD.jpg</a></p> <p>XML: <a href="http://i.imgur.com/6qiGVwQ.jpg" rel="nofollow">http://i.imgur.com/6qiGVwQ.jpg</a></p> <p>Thank you very much for reading!</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.
    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