【问题标题】:After Deploy/Publishing WCF server doesn't work部署/发布 WCF 服务器后不起作用
【发布时间】:2013-05-20 17:51:21
【问题描述】:

我有一个 WCF 服务,当我签入 WCF 测试客户端时它工作正常,但是在我将服务部署到远程服务器(我的大学服务器)之后它就不起作用了。我在 wp8 应用程序上运行它,但它没有给我错误,所以我在 wcf 测试客户端上运行它,我发现我无法连接到我的数据库,我不知道为什么!

我在网上搜索有关连接字符串的信息,因为每个人都告诉我可能是这样,但一切看起来都很好:(

这是我的连接字符串:

<connectionStrings>
<add name="dbPulpoConnectionString" providerName="System.Data.SqlClient" connectionString="Server=(LocalDb)\v11.0;Initial Catalog=PulpoDatabase;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\PulpoDatabase.mdf"/>

我也改成:

 <connectionStrings>
<add name="dbPulpoConnectionString" providerName="System.Data.SqlClient" connectionString="Server=.\SQLEXPRESS;Initial Catalog=PulpoDatabase;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\PulpoDatabase.mdf"/>

但是还是不行>

编辑:在我的专有名词中它说 .NET FRAMWORK 4.5

请帮帮我,我不知道该怎么办了>

编辑:我有我需要的所有前提在远程服务器上,在远程服务器上我有 App_Data 文件夹,我的 database.mdf 文件在那里,web.config 和 bin 以及 wcf.svc 服务器

编辑:我的错误:

Object reference not set to an instance of an object. Server stack trace: at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter) at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at IPulpoService.ShowStatistics(UserVO client) at PulpoServiceClient.ShowStatistics(UserVO client)

【问题讨论】:

  • 您能否发布您收到的实际错误消息?

标签: mysql wcf connection-string wcf-data-services publish


【解决方案1】:

如果您使用集成安全性来访问数据库,您可能需要使用模拟,以便服务在访问数据库时假定客户端的身份。否则,它将作为可能无权访问数据库的本地系统帐户(或其某种类型)运行。 要对此进行测试,您可以尝试更改连接字符串以使用 SQL Server 安全性并将用户名和密码放入连接字符串中,然后查看是否有效。显然,这只是一个测试 - 您实际上不应该像在“实时”环境中那样将密码保存在文件中。

【讨论】:

  • 没有用,我输入了用户名和密码,但还是没有用
猜你喜欢
  • 2021-10-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-11-26
  • 2016-10-04
  • 2021-07-09
相关资源
最近更新 更多