简单Web Service出现问题
仅仅利用.net自己带的那个HelloWorld的服务,然后我添加了一个ASP.NET,
private void Button1_Click(object sender, System.EventArgs e)
{
localhost.Service1 ws1 = new localhost.Service1();
TextBox1.Text = ws1.HelloWorld();
}
就出现以下错误,怎么回事啊?
Server Error in '/HelloWorldApp' Application.
--------------------------------------------------------------------------------
The underlying connection was closed: Unable to connect to the remote server.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.WebException: The underlying connection was closed: Unable to connect to the remote server.
Source Error:
Line 35: [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/HelloWorld", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
Line 36: public string HelloWorld() {
Line 37: object[] results = this.Invoke("HelloWorld", new object[0]);
Line 38: return ((string)(results[0]));
Line 39: }