To write a Java service. right click on the folder in navigation panel under which you want to create java service. you will get option select new and then select Java service. It will create Java Service in that particular folder. Rename the Service and start coding 
To write Java service you can either write it in note pad or you can use IDE like Eclipse or NetBeans. In b/w webMethod can also generate code for you, but you have to make modification to this code as per your requirement.
If you can tell what actually you want to achieve by java service, may be we can help you in better passion.
To check the syntax and all you can refer to documentation.
#Integration-Server-and-ESB#Flow-and-Java-services#webMethods