English 中文(简体)
Trouble Getting Data from a Webservice using Qooxdoo
原标题:

My capstone team has decided to use Qooxdoo as the front end for our project. We re developing apps for OpenFlow controllers using NOX, so we re using the NOX webservices framework. I m having trouble getting data from the service; I know the service is running because if I go to the URL using Firefox the right data shows up. Here s the relevant portion of my code:

var req = new qx.io.remote.Request("http://localhost/ws.v1/hello/world",
                                   "GET", "text/plain");

req.addListener("complete", function(e) {
  this.debug(e.getContent());
});

var get = new qx.ui.form.Button("get");
get.addListener("execute", function() {
  alert("The button has been pressed");
  req.send();
}, this);
form.addButton(get);

In the firebug console I get this message after I click through the alert:

008402 qx.io.remote.Exchange: Unknown status code: 0 (4)

And if I press the Get button again I get this error:

027033 qx.io.remote.transport.XmlHttp[56]: Failed with exception: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIXMLHttpRequest.open]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: file:///home/user/qooxdoo-1.0-sdk/framework/source/class/qx/io/remote/transport/XmlHttp.js :: anonymous :: line 279" data: no]

I ve also looked at the Twitter Client tutorial, however the "dataChange" event I set up in place of the "tweetsChanged" event never fired. Any help is appreciated, thank you.

最佳回答

This sound like a cross domain request issue. qx.io.remote.Request uses XHR for transporting the data which may not work in every case due to the browser restriction. Switching the crossDomain flag on the request to true will change from XHR to a dynamically inserted script tag doesn t have the cross domain restriction (but other restrictions).

req.setCrossDomain(true);

Maybe that solves your problem. Additionally, you can take a look at the documentation of the remote package to get some further details on cross domain requests: http://demo.qooxdoo.org/current/apiviewer/#qx.io.remote

Also take care not to use a request object twice. The only work once.

问题回答

暂无回答




相关问题
IIS 6.0 hangs when serving a web-service

I am having issues with one of our web-services. It works fine on my development machine (win XP) whether I host it as a separate application or using cassini from Visual studio. Once I deploy on the ...

ASP.net web services

I am using a web service which sets the Thread.CurrentPrincipal object while logging in and soon later when another webmethod of the same web service accesses Thread.CurrentPrincipal, its different/...

Unity Container Disposing and XML Web Service

I am registering some wrapers over un-managed objects in container. How can I dispose of them at the end of the container s lifetime? Please bear in mind I have an XML Web service.

SharePoint : web service permission error

I have a sharepoint site, and I am calling a standard sharepoint web service. I create the web service request like this : wsDws.Url = this.SiteAddress + @"/_vti_bin/Dws.asmx"; When I use ...

热门标签