Hello,
I am using netbeans and I am Trying simple Web service using Codename one 
annotation and when i did simple method returns string it's giving error
My Code:

package com.hesham.pack1;
import com.codename1.ws.annotations.WebService;
@WebService(exports = "../../../MySQLClient") 
public class MySQLWS1 {

public static int sum(int a, int b) { 
return a + b; 
}

public static String saySomthing(String message) { 
return "Hello from Server : " + message; 
}
}


error while building this project :

E:\Cross_Platform_Course\NetBeansProjects\MySQLWS\build\generated-sources\ap-source-output\com\hesham\pack1\MySQLWS1Servlet.java:43:
 
error: illegal start of expression 
ProxyServerHelper.writeResponse(response, def_saySomthing, (class 
java.lang.String)MySQLWS1.saySomthing((String)args[0])); 
E:\Cross_Platform_Course\NetBeansProjects\MySQLWS\build\generated-sources\ap-source-output\com\hesham\pack1\MySQLWS1Servlet.java:43:
 
error: ')' expected 
ProxyServerHelper.writeResponse(response, def_saySomthing, (class 
java.lang.String)MySQLWS1.saySomthing((String)args[0])); 
E:\Cross_Platform_Course\NetBeansProjects\MySQLWS\build\generated-sources\ap-source-output\com\hesham\pack1\MySQLWS1Servlet.java:43:
 
error: not a statement 
ProxyServerHelper.writeResponse(response, def_saySomthing, (class 
java.lang.String)MySQLWS1.saySomthing((String)args[0])); 
E:\Cross_Platform_Course\NetBeansProjects\MySQLWS\build\generated-sources\ap-source-output\com\hesham\pack1\MySQLWS1Servlet.java:43:
 
error: ';' expected 
ProxyServerHelper.writeResponse(response, def_saySomthing, (class 
java.lang.String)MySQLWS1.saySomthing((String)args[0])); 
E:\Cross_Platform_Course\NetBeansProjects\MySQLWS\build\generated-sources\ap-source-output\com\hesham\pack1\MySQLWS1Servlet.java:43:
 
error: ';' expected 
ProxyServerHelper.writeResponse(response, def_saySomthing, (class 
java.lang.String)MySQLWS1.saySomthing((String)args[0])); 
5 errors 
2 warnings 
E:\Cross_Platform_Course\NetBeansProjects\MySQLWS\nbproject\build-impl.xml:899: 
The following error occurred while executing this line: 
E:\Cross_Platform_Course\NetBeansProjects\MySQLWS\nbproject\build-impl.xml:321: 
Compile failed; see the compiler error output for details. 
BUILD FAILED (total time: 2 seconds)
i noticed if i changed the return type of saySomthing method to int , it's 
working fine


so what is the problem with returning string please

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/9400a124-86ce-4262-b408-2080497cec87%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to