response.setHeader(keys[i].toString(),value);
in a servlet is throwing null pointer exception even though none of keys[i] or value are null why is it so?
So, I'm using freemarker templates with Struts2 to formulate my responses. However, since I'm trying to use taconite as well, I need the response to be sent with the content type of "text/xml". I can't seem to find a way to use freemarker directives to set the content type, and I am not well versed enough in struts to know if there is a way to do it through that.
So, how should I go about this?
I am developing a C# application to automate the running of a legacy VBScript(vbs) file which calls several VB6 .exe files. The .exe files have message box pop-ups that I need to 'respond' to in order to allow the VBScript process to run unattended. The response would need to be the Enter key. I do not have the source for the .exe files and I do not know exactly what they do.
I would greatly appreciate any help with this...
I am writing a simple REST service, which responds to requests from clients. All in PHP.
My concern is, that when my server responds to a request, it could end up tying up resources if the client side is too slow in sending back "ok" response.
How do I send a POST request via lib_curl setting it to not wait for any responses, but rather quit immidiately after the POST data have been sent?
Is this even possible? Thank you !
I'm refactoring some client-server code and it uses the terms Response, Result & Reply for the same thing (an answer from the server). And although its not really that important it's become hard to guess which word to use while writing new code, so I'd like to unify the three terms into one and do the appropriate refactoring, but I'm not sure which word is the "best", if there is such a thing.
Any suggestions based on precedence and standards towards naming for this case?
I have to create a web service for iPhone. So I would like to know which web response is the best for iPhone(SOAP vs REST vs XML vs JSON vs ... any other).
I was trying to get fresh copy of my project from github using tortoise svn client. But I am getting following exception.
The PROPFIND request returned invalid XML in the response: XML parse
error at line 1: no element found
(Checkout from https://github.com/anoopchaurasia/JavaScript-File-Manager.git)
When I tried to checkout using subeclipse on Eclipse, it saying "Folder does not exist.".
I am able to checkout same repository on my other system.
I am trying to get the response codes from Mechanize in python. While I am able to get a 200 status code anything else isn't returned (404 throws and exception and 30x is ignored). Is there a way to get the original status code?
Thanks
We are trying to install:
http://www.activecampaign.com/activespell/
But are getting this JS error:
[CPAINT Error] invalid HTTP response code '404'
It seems the ajax is unable to access something, but not sure what or why, anyone experienced this problem before?
This question relates to the command line version of cURL.
I'm trying to download a file from a cgi script.
http://someserver/perl/dl.pl?ID=2
Using a browser the filename comes up as 'remotefilename.gz'
cURL wants to save the file as 'dl.pl?ID=2'
How do I get cURL to save to a file with the filename from the response header??
When I try to create a jquery alert coming from an ajaxy query, I don't get any response. Do you know how to fix it ?
jquery:
$.ajax({
type: "GET",
url: "php/submission.php",
success:function(data){
if(data==1)
{
alert("working");
}
}
});
submission.php:
echo '1';
How can I return an response (lets say an array) to the client with a name assign to it form a python script.
echo '{"jsonValidateReturn":'.json_encode($arrayToJs).'}';
in this scenario it returns an array with the name(jsonValidateReturn) assign to it also this can be accessed by jsonValidateReturn[1],so I want to do the same using a python script.
I tried it once but it didn't go well
array_to_js = [vld_id, vld_error, False]
array_to_js[2] = False
jsonValidateReturn = simplejson.dumps(array_to_js)
return HttpResponse(jsonValidateReturn, mimetype='application/json')
Thanks.
I get a JSON response as
{
"edges": [],
"nodes": []
}
how to check if the objects has null values and handle the case??
JSONObject jobj = new JSONObject(line);
JSONArray jArray = jobj.getJSONArray("edges");
if(jArray.length()!=0)
{
for(int i=0;i<jArray.length();i++){
JSONObject json_data = jArray.getJSONObject(i);
x.add((float) json_data.getInt("x"));
y.add((float) json_data.getInt("y"));
end
This retrurns me : org.json.JSONException: end of input at character 0 of
I'm using selenium IDE to test my webpages but unfortunately I cannot use it to test those pages that return an xml response. Some people use Selenium Remote Control, others use modules like WWW::Mechanize and Test::XML or Test::XPath.
What is the best way to test the XML responses?
I keep getting an error:
A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll An exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll but was not handled in user code The thread '' (0x27ee4) has exited with code 0 (0x0).
I was told it was related to this:
protected void Button1_Click(object sender, EventArgs e)
{
Response.Redirect("Results.aspx?Keywords=" + searchString.Text);
}
I figured it may help to include my complete code. The code above is the only C# code on my first asp page.
That code relates to this code on this page. It is also the only C# code I have on my second page. I am simply just trying to pass a keyword from a search form to this block of code:
if (Request.QueryString["Keywords"] != null){
string keywords = Request.QueryString["Keywords"];
string myAppID = "HIDDEN";
var xml = XDocument.Load("http://svcs.ebay.com/services/search/FindingService/v1?OPERATION-NAME=findItemsByKeywords&SERVICE-VERSION=1.0.0&SECURITY-APPNAME=" + myAppID + "&RESPONSE-DATA-FORMAT=XML&REST-PAYLOAD&keywords=" + keywords + "&paginationInput.entriesPerPage=5");
XNamespace ns = "http://www.ebay.com/marketplace/search/v1/services";
var titles = from item in xml.Root.Descendants(ns + "title")
select new{
title = xml.Descendants(ns + "title").Select (x => x.Value),
};
foreach (var item in titles){
Label1.Text += item;
}
}
This block of code calls the keyword value and uses it in an api to perform a search. The code of the xml(api) formats like this:
<findItemsByKeywordsResponse xmlns="http://www.ebay.com/marketplace/search/v1/services">
<searchReslut count="5">
<item>
<title></title>
</item>
<item>
<title></title>
</item>
<item>
<title></title>
</item>
Why am I getting this error how do you fix it?
hi,
I want to know what exactly is the functionality of isResponseRequired (MQ Transport)option in proxy and business service. My understanding was that a Proxy can read from a queue and business service can write to a queue. Is it possible for a Proxy to write the response to a queue?
I have a page that comes back as an UnexpectedPage in HtmlUnit, the response is JSON. Can I use HTMLUnit to parse this or will I need an additional library?
I recently posted a detailed description of the issue I am facing here at SO. As I couldn't send an actual $http request, I used timeout to simulate asynchronous behavior. Data binding from my model to view is working correct, with the help of @Gloppy
Now, when I use $http instead of $timeout (tested locally), I could see the asynchronous request was successful and data is filled with json response in my service. But, my view is not updating.
updated Plunkr here
Hi, I have an Ajax function which will retrieve some RSS feed script from server. I put this responsetext in a div using:
$("#divId").html(responsetext);
I want to execute the script inside the response. Currently, the RSS feeds not showing in the div. Is there any way to do that ? thanks..
My firefox downloads the JSON response of an AJAX call as a file.
It's suppose to be handled by the JavaScript i.e. JSON object.
Can anyone explain how to stop this behavior or there is something I am missing.
Thanks.
Content-Length header is missing when I try to download rar, exe, msi static files, though response for images contains Content-Length, but if I change rar extension to jpg it doesn't.
How do I solve this?
Using HttpClient 4.0, Im having an issue where the response I get from the ResponseHandler is only about half of what the actual page content should be (~61k bytes in the string vs ~125k in the page returned to a browser). I cant seem to find any place where there might be some sort of limit that would limit this. Any ideas?