我正在寻找一种从C客户端调用GWT服务的简单方法。对于服务器端,我使用简单的Gwt默认源:
public String greetServer(String input) throws IllegalArgumentException {
// Verify that the input is valid.
if (!FieldVerifier.isValidName(input)) {
// If the input is not valid, throw an IllegalArgumentException Back to:
// the client.
throw new IllegalArgumentException(
"Name must be at least 4 characters long");
}
String serverInfo = getServletContext().getServerInfo();
String userAgent = getThreadLocalRequest().getHeader("User-Agent");
// Escape data from the client to avoid cross-site script vulnerabilities.
input = escapeHtml(input);
userAgent = escapeHtml(userAgent);
return "Hello, " + input + "!<br><br>I am running " + serverInfo
+ ".<br><br>It looks like you are using:<br>" + userAgent;
}
现在,我已经从C客户端创建了一个RPC调用,该调用将使用greetServer
参数调用String
。那么我必须使用哪种库,以及如何在客户端识别此服务(greetServer
)。我发现了library,但我不知道它是否适合我。
任何想法?