Create simple class like :
@WebService()
public class HelloWorld {
@WebMethod
public String sayHelloWorldFrom(String from) {
String result = "Hello, world, from " + from;
System.out.println(result);
return result;
}
public static void main(String[] argv) {
Object implementor = new HelloWorld ();
String address = "http://localhost:9000/HelloWorld";
Endpoint.publish(address, implementor);
}
}
I generated it by using new project -> select WebApp + WS
2. Change
public String sayHelloWorldFrom(String from) {
to
public String sayHelloWorldFrom(MyString from) {
3. Editor highlights method name and class MyString as red
4. Click on MyString, Alt+Enter and then select "Create Class 'MyString' " action
5. This will generate class MyString
6. Go to HelloWorld and press Ctrl+Shift+F9
7. IDEA will say that it cannot find symbol class YString and highlight class HelloWorld in red (on tab, in explorer, in nabigation bar widget)
8. Click on MyString.java tab and press Ctrl+Shift+F9
9. Click on HelloWorld.java tab and click Ctrl+Shift+F9
IDEA still highlights class HelloWorld in red (on tab, in explorer, in nabigation bar widget) Highlights disappears when IDEA window loses focus