我正在尝试创建一个WebService。我无法访问该URL。如果我尝试连接到
http://192.168.10.203:8080/EchoBeanService/EchoBean?wsdl
我得到了一个错误:
Firefox can't establish a connection to the server at 192.168.10.203:8080
但是,如果我能够连接到URL中的using localhost:
http://localhost:8080/EchoBeanService/EchoBean?wsdl
爪哇回声
package services;
public interface Echo {
public String printEcho();
public String printEchoParam(String str);
}
Java语言
包装模型;
import javax.jws.WebService;
import javax.ejb.Stateless;
import javax.jws.WebMethod;
import services.Echo;
@Stateless
@WebService
public class EchoBean implements Echo {
public EchoBean(){}
@WebMethod
public String printEcho(){
return "WebServices Echo ";
}
@WebMethod
public String printEchoParam(String str){
return ("In PrintEcho( String " + str +" )" );
}
}
- H