无法反射方法

liuronghangzhou 2009-07-09 01:39:03
无法反射方法 我调用webserivce的方法 报错:无法反射方法 有什么解决的办法没有??
...全文
476 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
firehou 2011-06-07
  • 打赏
  • 举报
回复
http://blog.csdn.net/firehou/archive/2011/06/05/6527041.aspx
firehou 2011-06-03
  • 打赏
  • 举报
回复
C# winform中引用WCF,在引用时直接写文件名如,http://www.xxx.cn/WCF/UpLoadService.svc,不要加?及后面的
blodfox777 2009-07-10
  • 打赏
  • 举报
回复
需要在项目上添加System.Web.Services的引用
liuronghangzhou 2009-07-10
  • 打赏
  • 举报
回复
方法是public的
lwj7891875 2009-07-10
  • 打赏
  • 举报
回复
liuronghangzhou 2009-07-10
  • 打赏
  • 举报
回复
不是连接的问题
我是。net的
为题的异常信息是:
************** 异常文本 **************
System.InvalidOperationException: 无法反射方法 Service1.UserLogin。 ---> System.IO.FileNotFoundException: 找不到文件或程序集名称“System.Web.Services”,或找不到它的一个依赖项。
文件名: “System.Web.Services”
at System.Reflection.CustomAttribute.GetDataForPropertyOrField(Boolean& isProperty, Object& value, Type& type, Boolean isLast)
at System.Reflection.CustomAttribute.GetObject()
at System.Reflection.CustomAttribute.CheckConsistencyAndCreateArray(CustomAttribute caItem, Type caType)
at System.Reflection.CustomAttribute.GetCustomAttributes(MemberInfo member, Type caType, Boolean inherit)
at System.Reflection.RuntimeMethodInfo.GetCustomAttributes(Type attributeType, Boolean inherit)
at System.Web.Services.Protocols.LogicalMethodInfo.GetCustomAttributes(Type type)
at System.Web.Services.Protocols.SoapReflector.GetSoapMethodAttribute(LogicalMethodInfo methodInfo)
at System.Web.Services.Protocols.SoapReflector.ReflectMethod(LogicalMethodInfo methodInfo, Boolean client, XmlReflectionImporter xmlImporter, SoapReflectionImporter soapImporter, String defaultNs)

=== Pre-bind state information ===
LOG: DisplayName = System.Web.Services, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=969db8053d3322ac
(Fully-specified)
LOG: Appbase = H:\Demo\bin\Debug\
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
===

LOG: Publisher policy file is not found.
LOG: Host configuration file not found.
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\config\machine.config.
LOG: Post-policy reference: System.Web.Services, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=969db8053d3322ac
LOG: Attempting download of new URL file:///H:/Demo/bin/Debug/System.Web.Services.DLL.
LOG: Attempting download of new URL file:///H:/Demo/bin/Debug/System.Web.Services/System.Web.Services.DLL.
LOG: Attempting download of new URL file:///H:/Demo/bin/Debug/System.Web.Services.EXE.
LOG: Attempting download of new URL file:///H:/Demo/bin/Debug/System.Web.Services/System.Web.Services.EXE.

--- 内部异常堆栈跟踪的结尾 ---
at System.Web.Services.Protocols.SoapReflector.ReflectMethod(LogicalMethodInfo methodInfo, Boolean client, XmlReflectionImporter xmlImporter, SoapReflectionImporter soapImporter, String defaultNs)
at System.Web.Services.Protocols.SoapClientType..ctor(Type type)
at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor()
at Demo.WebService.Service1..ctor() in H:\Demo\Web References\WebService\Reference.cs:line 30
at Demo.Form1.btnLogin_Click(Object sender, EventArgs e) in h:\demo\form1.cs:line 132
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

小凤雏 2009-07-09
  • 打赏
  • 举报
回复
具体是什么错误呢?是连接问题吗
blodfox777 2009-07-09
  • 打赏
  • 举报
回复
把方法标记成public了吗?
weixiaolong 2009-07-09
  • 打赏
  • 举报
回复
没整过 这个问题应该问java 那里的高手多

62,025

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧