WebService error

18 views
Skip to first unread message

hesham...@gmail.com

unread,
Nov 3, 2016, 3:43:57 AM11/3/16
to CodenameOne Discussions
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

Steve Hannah

unread,
Nov 3, 2016, 12:24:29 PM11/3/16
to codenameone...@googlegroups.com
Thanks for reporting this.  I have made the fix and pushed all changes to github.  Please re-download the cn1rpc jar and add it to your project again.

Steve

--
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 codenameone-discussions+unsub...@googlegroups.com.
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.



--
Steve Hannah
Software Developer
Codename One

hesham...@gmail.com

unread,
Nov 3, 2016, 2:47:19 PM11/3/16
to CodenameOne Discussions
Thanks a lot Steve, it's working now.
Reply all
Reply to author
Forward
0 new messages