Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » UnsupportedMediaException when calling webservice
UnsupportedMediaException when calling webservice [message #1239498] Tue, 04 February 2014 10:13 Go to next message
Bertin Kiekebosch is currently offline Bertin KiekeboschFriend
Messages: 329
Registered: August 2011
Senior Member

I created a webService in Scout. Now I try to call this webservive from a plain html/javascript/jquery page. I tried about all the possible combinations of data, dataType and other parameters for my webservice but nothing seems to work. I always get an exception like below. Any idea what I am doing wrong?

Below is the soapRequest I made.

Regards Bertin

var wsUrl = 'http://localhost:8080/xplatformtest_server/jaxws/PersonenWebService/getPersonen';

var soapRequest = '<?xml version="1.0" encoding="utf-8"?>' +
	'<soap:Envelope xmlns:xsi="" '+ 
		'xmlns:xsd="" '+
		'xmlns:soap="" ' + 
		'xmlns:soapbind="" ' +
		'xmlns="">' +

$.ajax( {
	url: wsUrl,
       	dataType: "XML", 
	data: soapRequest,

feb 04, 2014 11:01:53 AM$HttpToolkit handle
SEVERE: Unsupported Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Supported ones are: [text/xml] Unsupported Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Supported ones are: [text/xml]
at org.eclipse.scout.jaxws.internal.servlet.ServletAdapter.handle(
at org.eclipse.scout.jaxws.internal.servlet.EndpointServlet.handleRequest(
at org.eclipse.scout.jaxws.internal.servlet.EndpointServlet.handleRequest(
at org.eclipse.scout.jaxws.internal.servlet.EndpointServlet.doPost(
at javax.servlet.http.HttpServlet.service(
at javax.servlet.http.HttpServlet.service(
at org.eclipse.scout.jaxws.JaxWsServlet.access$0(
at org.eclipse.scout.jaxws.JaxWsServlet$1$
Re: UnsupportedMediaException when calling webservice [message #1239552 is a reply to message #1239498] Tue, 04 February 2014 12:52 Go to previous message
Beat Schwarzentrub is currently offline Beat SchwarzentrubFriend
Messages: 63
Registered: November 2010
JAX-WS RI throws this exception when it encounters a message that is not correctly recognized as a SOAP message. In your case, the message body seem to be okay, but the HTTP headers are not. As the exception states, the "Content-type" header has to be of type "text/xml", but apparently jQuery sends "application/x-www-form-urlencoded" per default. Try setting the expected content-type explicitly then calling ajax().

Kind regards,
Previous Topic:Tab key in RAP
Next Topic:Single Sourcing RAP & SWT
Goto Forum:

Current Time: Sat Oct 29 00:02:28 GMT 2016

Powered by FUDForum. Page generated in 0.04931 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software