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