I have successfully created Web Service. Tested it and getting the WSDL file also. The client that will use this Web Service is a simple Java class.
I am able to create a jsp client and call the methods of Web Service. But I need to call the Web Service from a Java class.
How do I bind this Java client with Web Service?
The following steps I followed in NetBeans for creating the Java Client...
- I created a simple J2SE Application.
- Made it a Web Service Client of the WebService made by me.
- I'm getting the Web Service References of my WebService.
But I'm not able to call the method of the WebService. Here is the Client file...
package client_package;
public class client {
public static void main(String args[])
{
System.out.println("1");
System.out.println(hello("megha"));
System.out.println("2");
}
private static String hello(String name) {
WS_package.WebService1 service = new WS_package.WebService1(); //package WS_package does not exists
WS_package.WebService1 port = service.getWebService1Port(); //package WS_package does not exists
name = port.hello(name);
return name;
}
}
port.hello(name)
is not being called – Psychotic