Closed Bug 202725 Opened 17 years ago Closed 17 years ago

Calling getElementsByTagName (or similar) on SOAP response gives "permission denied" JS error

Categories

(Core Graveyard :: Web Services, defect)

x86
Windows NT
defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bugzilla, Assigned: harishd)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.3) Gecko/20030312
Build Identifier: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.3) Gecko/20030312

SOAP request and response is fine as long as the response is a simple list. As
soon as you return nested tags and start accessing them with DOM methods, you
get the JS error. The full error message is: -

Error: [Exception... "'Permission denied to call method
Element.getElementsByTagName' when calling method:
[nsISOAPResponseListener::handleResponse]"  nsresult: "0x8057001e
(NS_ERROR_XPC_JS_THREW_STRING)"  location: "<unknown>"  data: no]

I have seen the same message quoted in various other bugs, the common theme
being DOM rather than an XML. 

The URL posted is from what I'd guess is a pretty popular O'Reilly tutorial, so
one would think it would work. I guess therefore this is a platform-specific
problem. The similar bugs were often platform specific.



Reproducible: Always

Steps to Reproduce:
1. Goto the link provided. Copy-paste the HTML into a text file and save it locally.
2. Open the text file. 
3. Paste in a Google API key (which you'll have to aquire) and a search query,
and press go.

Actual Results:  
Nothing happened. An error appears in the JavaScript console.

Expected Results:  
Displayed the results of the SOAP response on the page.
That's just a standard security exception you get when you try to read the
contents of something off your server via the DOM....
That's fair enough, but the script allows for that by enabling
UniversalBrowserRead. 

I've tried mucking about with all the security settings that seem appropriate,
up to and including enabling allAccess, but can't get the exception to go away. 

The script ought to work as is. 
Over to Web Services.
Assignee: dom_bugs → harishd
Status: UNCONFIRMED → NEW
Component: DOM Core → Web Services
Ever confirmed: true
QA Contact: desale → ashishbhatt
The test case fails (ie nothing happens - with the corresponding js error) on
the nightly build 20030421 for linux too.  I haven't been able to satisfy
mozilla by requesting permissions with PrivilegeManager either.  I have also
seen "Access to property denied"  code: "1010" nsresult: "0x805303f2
(NS_ERROR_DOM_PROP_ACCESS_DENIED)" in my various attempts with this.

Thanks
Another thing I discovered in my efforts.  I can display the same soap response
that throws the js error with various DOM methods by calling:

  new XMLSerializer().serializeToString(soap_response.message);

on it with no problems.
taking SOAP bugs.
Assignee: harishd → jgaunt
Taking the bug back since I'm already working on it.
Assignee: jgaunt → harishd
The patch in bug 193953 should fix the problem. I've landed the fix on the
trunk. The attached test case works fine for me. 

Reporter please confirm in tomorrow's mozilla trunk. 
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.