以下是goDaddy机器上数据库的连接字符串。
Data Source=<ipaddress>;Initial Catalog=<dbName>;Persist Security Info=True;User ID=<userid>;Password=<pw>
现在有趣的是同一个字符串在本地机器上工作。通过visual studio解决任何查询。这个变化也反映在godaddy服务器上的myLittle Admin中。但是当我把它放到网站的web配置文件中时,每个操作抛出500:内部服务器错误。你能帮我解决这个问题吗?
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.5.1" />
<httpRuntime targetFramework="4.5.1" />
</system.web>
<connectionStrings>
<add name="DBCS"
connectionString ="<cs>"
providerName="System.Data.SqlClient"/>
<add name="DBCSProd"
connectionString ="<cs>"
providerName="System.Data.SqlClient"/>
<add name="DBCSLocal"
connectionString ="<cs>"/>
</connectionStrings>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="CalculatorWebServiceSoap" allowCookies ="True"/>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:4661/WebServices/CalculatorWebService.asmx"
binding="basicHttpBinding" bindingConfiguration="CalculatorWebServiceSoap"
contract="CalculatorAdd.CalculatorWebServiceSoap" name="CalculatorWebServiceSoap" />
</client>
</system.serviceModel>
</configuration>
我也尝试取出system.service模型。但没用。
**General**
Request URL:http://<website>/<path>/checkDeliverableArea.asmx/checkDeliverableAreasBool
Request Method:POST
Status Code:500 Internal Server Error
Remote Address:50.62.160.127:80
Referrer Policy:no-referrer-when-downgrade
**Response Headers**
**view source**
Cache-Control:private
Content-Length:3420
Content-Type:text/html; charset=utf-8
Date:Mon, 02 Oct 2017 14:42:11 GMT
Server:Microsoft-IIS/8.0
X-AspNet-Version:4.0.30319
X-Powered-By:ASP.NET
X-Powered-By-Plesk:PleskWin
**view (source)**
HTTP/1.1 500 Internal Server Error
Cache-Control: private
Content-Type: text/html; charset=utf-8
Server: Microsoft-IIS/8.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
X-Powered-By-Plesk: PleskWin
Date: Mon, 02 Oct 2017 14:42:11 GMT
Content-Length: 3420
**Request Headers**
**view (parsed)**
Accept:application/json, text/javascript, */*; q=0.01
Accept-Encoding:gzip, deflate
Accept-Language:en-IN,en-GB;q=0.8,en-US;q=0.6,en;q=0.4
Connection:keep-alive
Content-Length:22
Content-Type:application/x-www-form-urlencoded; charset=UTF-8
Cookie:_ga=GA1.2.241910055.1503834936; _gid=GA1.2.1810498430.1506838482
Host:qa.pocketfarms.in
Origin:http://qa.pocketfarms.in
Referer:http://qa.pocketfarms.in/
User-Agent:Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36
**view(source)**
POST /WebService/Common/checkDeliverableArea.asmx/checkDeliverableAreasBool HTTP/1.1
Host: qa.pocketfarms.in
Connection: keep-alive
Content-Length: 22
Accept: application/json, text/javascript, */*; q=0.01
Origin: http://qa.pocketfarms.in
User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Referer: http://qa.pocketfarms.in/
Accept-Encoding: gzip, deflate
Accept-Language: en-IN,en-GB;q=0.8,en-US;q=0.6,en;q=0.4
Cookie: _ga=GA1.2.241910055.1503834936; _gid=GA1.2.1810498430.1506838482
**Form Data**
view (source)
view URL encoded
LookupParameter:411019
答案 0 :(得分:0)
您似乎正在使用网络服务,并且获取内部服务器错误500会将此代码放入您的网络配置中,然后重试。
`<configuration>
<system.web>
<webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>
</system.web>
</configuration>`