How to connect a non-gwt xmlrpc-client to a xmlrpc-server created by GWT.

32 views
Skip to first unread message

Johannes Held

unread,
Nov 16, 2011, 11:28:12 AM11/16/11
to google-we...@googlegroups.com
Hello group,

I have a small application programmed with GWT beeing deployed to a jetty as root.war (thus serving "/").
Assume I have a Servlet named "UserServlet" mapped to "/user/user" providing a method "getString()". On the server side, this method is implemented in the class "TestImpl".

Now I want to connect to the server not only via a GWT client but also via an external XMLRPC client.
Using the code (attached as ClientCode.java - stripped down version, won't compile), the jetty server logs this:
2011-11-16 17:08:12.379:WARN:root:Exception while dispatching incoming RPC call
javax.servlet.ServletException: Content-Type was 'text/xml'. Expected 'text/x-gwt-rpc'.

May someone give me a hint, how I can connect to a GWT-created servlet via a normal XMLRPC client?
I saw a project called xmlrpc-gwt, but that includes a lot of GWT related stuff and I want to try to keep the XMLRPC client really simple.
Next, looking into the code of
xmlrpc-gwt, it sends a header "text/xml", too.


Looking forward to your answers,
Johannes


ClientCode.java

jhulford

unread,
Nov 17, 2011, 9:47:41 AM11/17/11
to Google Web Toolkit
If your servlet is extending the RemoteServiceServlet from the GWT
code (as it appears you're doing based on the error), then the only
data format that can be parsed from a client request is the GWT-RPC
one.

If you want to do xml-rpc, you'll need to write your own backend to
support that, or find a 3rd party lib that has done so already. I'm
sure there has to be several.
>  ClientCode.java
> < 1KViewDownload
Reply all
Reply to author
Forward
0 new messages