托管在一台服务器上的WCF服务工作正常。托管在另一台服务器上给出错误 [英] WCF service hosted in one server working fine. hosted on another server giving error

查看:67
本文介绍了托管在一台服务器上的WCF服务工作正常。托管在另一台服务器上给出错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好:



我有这个有线问题。我用三种方法开发了一个WCF服务。安装在我的开发服务器的IIS 6.0中,一切都只是文件。当我在生产服务器的IIS 6.0上安装它时,它会发出以下序列化错误。当我尝试运行svcutil.exe时出现同样的错误



ms visual studio 2008,framework 3.5,IIS 6.0





合同:http://tempuri.org/:IOptiWeb ----> System.Runtime.Serialization.InvalidDataContractException:类型''OptiWeb.GetResultRequestLineType''无法序列化。考虑使用DataContractAttribute属性标记它,并标记要使用DataMemberAttribute属性序列化的所有成员。

在System.Runtime.Serialization.DataContract.DataContractCriticalHelper.Throw InvalidDataContractException(String message,Type type)

在System.Runtime.Serialization.DataContract.DataContractCriticalHelper.CreateDataContract(Int32 id,RuntimeTypeHandle typeHandle,Type type)

at System.Runtime.Serialization.DataContract.DataContractCriticalHelper.GetDataContractSkipValidation (Int32 id,RuntimeTypeHandle typeHandle,Type type)





我认为这与服务器安全性有关。任何帮助将不胜感激

Hi All:

I have this wired problem. I developed a WCF service with three methods. installed in my development server''s IIS 6.0 and everything works just file. When I installed it on a production server''s IIS 6.0 it''s giving the following serialization error. I get the the same error when I try to run svcutil.exe

ms visual studio 2008, framework 3.5, IIS 6.0


contract: http://tempuri.org/:IOptiWeb ----> System.Runtime.Serialization.InvalidDataContractException: Type ''OptiWeb.GetResultRequestLineType'' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute.
at System.Runtime.Serialization.DataContract.DataContractCriticalHelper.Throw InvalidDataContractException(String message, Type type)
at System.Runtime.Serialization.DataContract.DataContractCriticalHelper.CreateDataContract(Int32 id, RuntimeTypeHandle typeHandle, Type type)
at System.Runtime.Serialization.DataContract.DataContractCriticalHelper.GetDataContractSkipValidation(Int32 id, RuntimeTypeHandle typeHandle, Type type)


I am think it is something to do with the server security. Any help will be appreciated

推荐答案

感谢db7uk,问题已经解决,当我回复你时我注意到其中一个子类没有datacontract属性。一旦我补充说它开始工作就好了。我想我的开发服务器设置更好。
Thanks db7uk, the problem has been resolved, when I was responding to you I noticed that one of the sub class didn''t have the datacontract attribute. once I added that it started to work just fine. I guess I have a better strust setup with the development server.


这篇关于托管在一台服务器上的WCF服务工作正常。托管在另一台服务器上给出错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆