users@glassfish.java.net

REST endpoints with _at_WebServiceProvider and the Content-type HTTP request header

From: Mark Hansen <marklists_at_javector.com>
Date: Fri, 05 Jan 2007 17:48:29 -0500

I'm trying to deploy a @WebServiceProvider to create a RESTful endpoint
that takes no XML in the request - but just HTTP parameters. For
something similar see the Yahoo Shopping API:
http://developer.yahoo.com/shopping/

One nice thing about Yahoo Shopping is that you can invoke the RESTful
endpoints using your browser by putting the parameters in the query
string, like this:
http://api.shopping.yahoo.com/ShoppingService/V2/productSearch?%20appid=YahooDemo&query=erector

When I try to deploy a similar type of endpoint using GlassFish
@WebServiceProvider, it works OK when I invoke it from a URLConnection
inside a Java client. However, it doesn't work from a browser
(Firefox). I get the below error in the server.log. I assume the error
results from the Content-type the browser is setting (or not setting -
since I'm seeing an NPE) being rejected by the HTTPAdapter.

Is this a bug? Or do the JAX-WS specs require something like having the
Content-type set to text/xml?

-- Mark