当前位置: 代码迷 >> Web Service >> aspx调用web services调试通过,发布到网站上时出现异常
  详细解决方案

aspx调用web services调试通过,发布到网站上时出现异常

热度:620   发布时间:2011-12-29 22:09:38.0
aspx调用web services调试通过,发布到网站上时出现错误
“/”应用程序中的服务器错误。
--------------------------------------------

由于目标计算机积极拒绝,无法连接。 
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 

异常详细信息: System.Net.Sockets.SocketException: 由于目标计算机积极拒绝,无法连接。

源错误: 


行 59: [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/addition", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
行 60: public double addition(double i, double j) {
行 61: object[] results = this.Invoke("addition", new object[] {
行 62: i,
行 63: j});
 

源文件: e:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6ac46272\83444449\App_WebReferences.llqb1_l4.0.cs 行: 61 

堆栈跟踪: 


[SocketException (0x274d): 由于目标计算机积极拒绝,无法连接。]
  System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +1029090
  System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) +33
  System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) +431

[WebException: 无法连接到远程服务器]
  System.Net.HttpWebRequest.GetRequestStream() +1530701
  System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +103
  localhost.Service.addition(Double i, Double j) in e:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\6ac46272\83444449\App_WebReferences.llqb1_l4.0.cs:61
  _Default.btn_Click(Object sender, EventArgs e) in d:\http\Default.aspx.cs:35
  System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
  System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
  System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
  System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
  System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
  System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102

 


------解决方案--------------------
你检查一下web.config文件里的service的链接地址:
一般开发时默认是本机的,你如果发布了就有改到服务器。
<applicationSettings>
<Chant.Client.Properties.Settings>
<setting name="ChantMES_Client_localhost_Service" serializeAs="String">
<value>http://localhost:3917/ChantMES_Service/Service.asmx</value>
</setting>
</Chant.Client.Properties.Settings>
</applicationSettings>
  相关解决方案