WCF正在生产服务器上显示开发机器路径

时间:2015-10-28 18:32:15

标签: asp.net .net wcf

我已经在vs 2013上部署了一个wcf服务应用程序,我将项目发布到文件系统并将已发布的版本移到生产服务器上。现在,当我从生产服务器访问服务时,它会尝试连接到本地开发机器,在那里它会显示异常

The server encountered an error processing the request. The exception message is 'Unable to connect to the remote server'. 


<?xml version="1.0"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <!--
    For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.

    The following attributes can be set on the <httpRuntime> tag.
      <system.Web>
        <httpRuntime targetFramework="4.5" />
      </system.Web>
  -->
  <system.web>
    <compilation targetFramework="4.5"/>
    <httpRuntime/>
    <pages controlRenderingCompatibilityVersion="4.0"/>
 <customErrors mode="Off"/>
  </system.web>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
    <httpProtocol>
      <customHeaders>
        <add name="Access-Control-Allow-Origin" value="*"/>
        <add name="Access-Control-Allow-Headers" value="Content-Type, x-requested-with, origin, authorization, accept, client-security, X-PINGOTHER"/>
        <add name="Access-Control-Allow-Methods" value="GET, PUT, OPTIONS "/>
        <add name="Access-Control-Max-Age" value="3600"/>
        <add name="Access-Control-Allow-Credentials" value="true"/>
        <add name="Access-Control-Expose-Headers" value="DAV, content-length, Allow"/>
      </customHeaders>
    </httpProtocol>
  </system.webServer>
  <system.serviceModel>
    <behaviors>
      <endpointBehaviors>
        <behavior name="EndpBehavior">
          <webHttp/>
        </behavior>
      </endpointBehaviors>
      <serviceBehaviors>
        <behavior name="ServiceBehavior">
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <services>
      <service behaviorConfiguration="ServiceBehavior" name="ServiceWebApp.Service1">
        <endpoint address="" binding="webHttpBinding" contract="ServiceWebApp.IService1" behaviorConfiguration="EndpBehavior" />
      </service>
    </services>
    <bindings>
      <webHttpBinding>
        <binding name="secureHttpBinding">
          <security mode="Transport">
            <transport clientCredentialType="None" />
          </security>
        </binding>
      </webHttpBinding>
    </bindings>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="false" multipleSiteBindingsEnabled="true"/>
    <standardEndpoints>
      <webScriptEndpoint>
        <standardEndpoint crossDomainScriptAccessEnabled="true"/>
      </webScriptEndpoint>

    </standardEndpoints>
  </system.serviceModel>
</configuration>

0 个答案:

没有答案