我使用JAX-WS制作了Web服务。现在我想使用Web浏览器进行测试,但出现错误。有人能解释我请帮助。Web服务测试
我的服务类:
package another;
import javax.jws.WebService;
import javax.xml.ws.Endpoint;
@WebService(name = "WebService")
public class WebServiceTest {
public String sayHello(String name) {
return "Hello : " + name;
}
public static void main(String[] args) {
WebServiceTest server = new WebServiceTest();
Endpoint endpoint = Endpoint.publish(
"http://localhost:9191/webServiceTest", server);
}
}
我运行这个类作为简单的Java程序。
而且我可以在我的浏览器中看到WSDL,网址为http://localhost:9191/webServiceTest?wsdl
。
我试图用URL http://localhost:9191/webServiceTest?sayHello?name=MKGandhi
来调用它,但我没有得到任何结果。
这里有什么问题?