1

我已经编写了一个 Web 服务,从中我将数据传递到我的本地主机 Ms Sql DB。它在我的电脑上正常工作,但是当我将它托管在我的 godaddy Windows Vps 上时出现错误:

请求错误

服务器在处理请求时遇到错误。有关更多详细信息,请参阅服务器日志。

另请注意,我的 vps 上没有 MS SQL Server,因此我使用我的 RDP 手动安装了它。因此,如果有一些服务器设置要完成或者我必须更改我的 VPS,那么现在就不要了。下面是我的 web.config 请告诉我要做什么,因为我被困在网上找不到任何资源来解决这个问题。

网络配置

<?xml version="1.0"?>
<configuration>
  <connectionStrings>
    <add name="constr" connectionString="Data Source=IP-104-238-94-8;Initial Catalog=BaySideJournalDB ;Integrated Security=True" providerName="System.Data.SqlClient"/>
  </connectionStrings>
  <appSettings/>
  <system.web>
    <compilation targetFramework="4.0" debug="true"/>
    <httpRuntime/>
  </system.web>
  <system.serviceModel>
    <services>
      <service name="ShreeGanesh.BaySideService" behaviorConfiguration="ServiceBehavior">
        <endpoint address="" binding="webHttpBinding" contract="ShreeGanesh.IBaySideService" behaviorConfiguration="webHttp"/>
        <endpoint address="mex"
                binding="mexHttpBinding" contract="IMetadataExchange" />

      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="ServiceBehavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
        <behavior>
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="true"/>
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="webHttp">
          <webHttp/>
        </behavior>
      </endpointBehaviors>
    </behaviors>
       <serviceHostingEnvironment aspNetCompatibilityEnabled="false" multipleSiteBindingsEnabled="true"/>
  </system.serviceModel>
  <system.webServer>

    <directoryBrowse enabled="true"/>
    <defaultDocument>

      <files>`enter code here`
        <add value="BaySideService.svc"/>
      </files>

    </defaultDocument>
  </system.webServer>
</configuration>
4

0 回答 0