由于分不多,请知道的朋友帮忙了 谢谢
由于目标机器积极拒绝,无法连接。 127.0.0.1:2950 
说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.Net.Sockets.SocketException: 由于目标机器积极拒绝,无法连接。 127.0.0.1:2950源错误: 执行当前 Web 请求期间生成了未经处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。  堆栈跟踪: 
[SocketException (0x274d): 由于目标机器积极拒绝,无法连接。 127.0.0.1:2950]
   System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +225
   System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) +279[WebException: 无法连接到远程服务器]
   System.Net.HttpWebRequest.GetRequestStream(TransportContext& context) +6022813
   System.Net.HttpWebRequest.GetRequestStream() +13
   System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +110
   DictControl.DictControl.GetOrganizeCategory() +31
   Standard_Search2.DictInit() +91
   Standard_Search2.Page_Load(Object sender, EventArgs e) +61
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +91
   System.Web.UI.Control.LoadRecursive() +74
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207 
--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.0.30319.1 

解决方案 »

  1.   

    以下是web中配置的路径
    <add key="DictControl.DictControl" value="http://localhost:2950/StandardService/DictControl.asmx"/>
    <add key="SearchControl.SearchControl" value="http://localhost:2950/StandardService/SearchControl.asmx"/>
    <add key="StandardControl.StandardControl" value="http://localhost:2950/StandardService/StandardControl.asmx"/>
      

  2.   

    你的地址中用的localhost,是肯定不行的,
    把你的webservice部署到iis,可以默认用80,也可以自己分配端口,但是注意别被防火墙给堵了,在本地用ip去访问你的webservice
      

  3.   

    你的webservice是不是在本机部署呀?
      

  4.   

    webservice是在一个项目StandardService中调用,而我现在的项目web调用这个webservice,所以引用的地址为
    <add key="DictControl.DictControl" value="http://localhost:2950/cysut/StandardService/DictControl.asmx"/>
    <add key="SearchControl.SearchControl" value="http://localhost:2950/cysut/StandardService/SearchControl.asmx"/>
    <add key="StandardControl.StandardControl" value="http://localhost:2950/cysut/StandardService/StandardControl.asmx"/>
      

  5.   

    <add key="DictControl.DictControl" value="http://localhost:2950/cysut/StandardService/DictControl.asmx"/>
    <add key="SearchControl.SearchControl" value="http://localhost:2950/cysut/StandardService/SearchControl.asmx"/>
    <add key="StandardControl.StandardControl" value="http://localhost:2950/cysut/StandardService/StandardControl.asmx"/>改为没有端口
    <add key="DictControl.DictControl" value="http://localhost/cysut/StandardService/DictControl.asmx"/>
    <add key="SearchControl.SearchControl" value="http://localhost/cysut/StandardService/SearchControl.asmx"/>
    <add key="StandardControl.StandardControl" value="http://localhost/cysut/StandardService/StandardControl.asmx"/>
    则报以下错误,请帮忙,内容过长,做2次发
    “/Web”应用程序中的服务器错误。
    --------------------------------------------------------------------------------客户端发现响应内容类型为“text/html; charset=utf-8”,但应为“text/xml”。
    请求失败,错误信息为:
    --
    <html>
       <head>
           <title>配置错误</title>
           <style>
            body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} 
            p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
            b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
            H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
            H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
            pre {font-family:"Lucida Console";font-size: .9em}
            .er {font-weight: bold; color: black;text-decoration: none;}
            .version {color: gray;}
            .error {margin-bottom: 10px;}
            .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
           </style>
       </head>   <body bgcolor="white">           <span><H1>“/cysut/StandardService”应用程序中的服务器错误。<hr width=100% size=1 color=silver></H1>           <h2> <i>配置错误</i> </h2></span>           <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">           <b> 说明: </b>在处理向该请求提供服务所需的配置文件时出错。请检查下面的特定错误详细信息并适当地修改配置文件。
               <br><br>           <b> 分析器错误消息: </b>无法识别的属性“targetFramework”。请注意属性名称区分大小写。<br><br>           <b>源错误:</b> <br><br>           <table width=100% bgcolor="#ffffcc">
                  <tr>
                     <td>
                         <code><pre>行 29: 
    行 30:         -->
    <font color=red>行 31: <compilation debug="true" targetFramework="4.0">
    </font>行 32: <assemblies>
    行 33: <add assembly="System.Data.OracleClient, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></pre></code>                 </td>
                  </tr>
               </table>           <br>           <b> 源文件: </b> c:\inetpub\wwwroot\cysut\standardservice\web.config<b>    行: </b> 31
               <br><br>           <hr width=100% size=1 color=silver>           <b>版本信息:</b> Microsoft .NET Framework 版本:2.0.50727.1882; ASP.NET 版本:2.0.50727.1879           </font>   </body>
    </html>
    <!-- 
    [ConfigurationErrorsException]: 无法识别的属性“targetFramework”。请注意属性名称区分大小写。 (c:\inetpub\wwwroot\cysut\standardservice\web.config line 31)
      在 System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags)
    [HttpException]: 无法识别的属性“targetFramework”。请注意属性名称区分大小写。 (c:\inetpub\wwwroot\cysut\standardservice\web.config line 31)
      在 System.Web.HttpRuntime.FirstRequestInit(HttpContext context)
      在 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context)
      在 System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
    -->
    --. 
      

  6.   


    说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.InvalidOperationException: 客户端发现响应内容类型为“text/html; charset=utf-8”,但应为“text/xml”。
    请求失败,错误信息为:
    --
    <html>
       <head>
           <title>配置错误</title>
           <style>
            body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} 
            p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
            b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
            H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
            H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
            pre {font-family:"Lucida Console";font-size: .9em}
            .er {font-weight: bold; color: black;text-decoration: none;}
            .version {color: gray;}
            .error {margin-bottom: 10px;}
            .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
           </style>
       </head>   <body bgcolor="white">           <span><H1>“/cysut/StandardService”应用程序中的服务器错误。<hr width=100% size=1 color=silver></H1>           <h2> <i>配置错误</i> </h2></span>           <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">           <b> 说明: </b>在处理向该请求提供服务所需的配置文件时出错。请检查下面的特定错误详细信息并适当地修改配置文件。
               <br><br>           <b> 分析器错误消息: </b>无法识别的属性“targetFramework”。请注意属性名称区分大小写。<br><br>           <b>源错误:</b> <br><br>           <table width=100% bgcolor="#ffffcc">
                  <tr>
                     <td>
                         <code><pre>行 29: 
    行 30:         -->
    <font color=red>行 31: <compilation debug="true" targetFramework="4.0">
    </font>行 32: <assemblies>
    行 33: <add assembly="System.Data.OracleClient, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></pre></code>                 </td>
                  </tr>
               </table>           <br>           <b> 源文件: </b> c:\inetpub\wwwroot\cysut\standardservice\web.config<b>    行: </b> 31
               <br><br>           <hr width=100% size=1 color=silver>           <b>版本信息:</b> Microsoft .NET Framework 版本:2.0.50727.1882; ASP.NET 版本:2.0.50727.1879           </font>   </body>
    </html>
    <!-- 
    [ConfigurationErrorsException]: 无法识别的属性“targetFramework”。请注意属性名称区分大小写。 (c:\inetpub\wwwroot\cysut\standardservice\web.config line 31)
      在 System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags)
    [HttpException]: 无法识别的属性“targetFramework”。请注意属性名称区分大小写。 (c:\inetpub\wwwroot\cysut\standardservice\web.config line 31)
      在 System.Web.HttpRuntime.FirstRequestInit(HttpContext context)
      在 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context)
      在 System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
    -->
    --.源错误: 
    行 298:        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizeCategory", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
    行 299:        public System.Data.DataSet GetOrganizeCategory() {
    行 300:            object[] results = this.Invoke("GetOrganizeCategory", new object[0]);
    行 301:            return ((System.Data.DataSet)(results[0]));
    行 302:        }
     源文件: c:\windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\web\122fec77\dbc321fd\App_WebReferences.ipec0fdm.0.cs    行: 300 堆栈跟踪: 
    [InvalidOperationException: 客户端发现响应内容类型为“text/html; charset=utf-8”,但应为“text/xml”。
    请求失败,错误信息为:
    --
    <html>
        <head>
            <title>配置错误</title>
            <style>
             body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} 
             p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
             b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
             H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
             H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
             pre {font-family:"Lucida Console";font-size: .9em}
             .er {font-weight: bold; color: black;text-decoration: none;}
             .version {color: gray;}
             .error {margin-bottom: 10px;}
             .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
            </style>
        </head>    <body bgcolor="white">            <span><H1>“/cysut/StandardService”应用程序中的服务器错误。<hr width=100% size=1 color=silver></H1>            <h2> <i>配置错误</i> </h2></span>            <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">            <b> 说明: </b>在处理向该请求提供服务所需的配置文件时出错。请检查下面的特定错误详细信息并适当地修改配置文件。
                <br><br>            <b> 分析器错误消息: </b>无法识别的属性“targetFramework”。请注意属性名称区分大小写。<br><br>            <b>源错误:</b> <br><br>            <table width=100% bgcolor="#ffffcc">
                   <tr>
                      <td>
                          <code><pre>行 29: 
    行 30:         -->
    <font color=red>行 31:  <compilation debug="true" targetFramework="4.0">
    </font>行 32:  <assemblies>
    行 33:  <add assembly="System.Data.OracleClient, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></pre></code>                  </td>
                   </tr>
                </table>            <br>            <b> 源文件: </b> c:\inetpub\wwwroot\cysut\standardservice\web.config<b>    行: </b> 31
                <br><br>            <hr width=100% size=1 color=silver>            <b>版本信息:</b> Microsoft .NET Framework 版本:2.0.50727.1882; ASP.NET 版本:2.0.50727.1879            </font>    </body>
    </html>
    <!-- 
    [ConfigurationErrorsException]: 无法识别的属性“targetFramework”。请注意属性名称区分大小写。 (c:\inetpub\wwwroot\cysut\standardservice\web.config line 31)
       在 System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags)
    [HttpException]: 无法识别的属性“targetFramework”。请注意属性名称区分大小写。 (c:\inetpub\wwwroot\cysut\standardservice\web.config line 31)
       在 System.Web.HttpRuntime.FirstRequestInit(HttpContext context)
       在 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context)
       在 System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
    -->
    --.]
       System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) +1484902
       System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +221
       DictControl.DictControl.GetOrganizeCategory() in c:\windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\web\122fec77\dbc321fd\App_WebReferences.ipec0fdm.0.cs:300
       Standard_Search2.DictInit() in c:\Inetpub\wwwroot\cysut\Web\Standard\Search2.aspx.cs:43
       Standard_Search2.Page_Load(Object sender, EventArgs e) in c:\Inetpub\wwwroot\cysut\Web\Standard\Search2.aspx.cs:28
       System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
       System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
       System.Web.UI.Control.OnLoad(EventArgs e) +91
       System.Web.UI.Control.LoadRecursive() +74
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207 
    --------------------------------------------------------------------------------
    版本信息: Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.0.30319.1 
      

  7.   

    在iis中把默认网站asp.net版本调为4.0,同时在项目网站和项目中调为4.0问题就解决了。还没真正弄清楚什么问题。