• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Uncaught SyntaxError: Unexpected token < when calling java SOAP webservice

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am seriously stuck with this. I have created a webservice in Java and I am trying to use the response of the webservice in an html page. So I am using ajax call to the webservice and I get the error:

Resource interpreted as Other but transferred with MIME type undefined.
inputArrf:1Uncaught SyntaxError: Unexpected token <

The xml response from the webservice is:
<ns:inputArrfResponse xmlns:ns="http://wkr"><ns:return>hello</ns:return></ns:inputArrfResponse>

The soap client:
<html>
<body>
<script language="javascript" src="jquery-1.7.min.js"></script>

<script type="text/javascript">
$(document).ready(function(){

$.ajax({
type:'POST',
url: 'http://localhost:8080/WekaRaytheon/services/callClassifier/inputArrf',
data: "buf:hari",
dataType: 'jsonp',
processData: false,
contentType: 'application/json',
jsonpCallback: 'jsonpCallback',
success: callback,
error: function(){
alert("failed");
}
});

});

function callback(data){
alert(data);
$('#jsonpResult').text(data.message);
}
</script>
</body>
</html>


The above error is on chrome.I get a different error when i use firefox:
XML can't be the whole program.

Can someone please help me on resolving this. I have tried all possible ways suggest on google and this didnt work.
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Hari,

I have the exact same problem. have you been able to fix it?

 
Hari Phaneendra
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Raphael,

I am still looking for a solution to this. I had no luck so far
 
Ranch Hand
Posts: 491
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. Google for how to use SOAP UI or TCPMon to see the request sent and the response recieved from the server.

and http headers like content type.

2. If I read your ajax client correctly:

SOAP-based web service returned xml format where as your client json format.

Either change your's client to expect xml format OR Write your web service using Rest style and return data in json format.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic