菜鸟问题:webservice的调用!!c#winform的~~
小朵乌云 2006-09-21 01:51:53 偶是新手~刚学WebService的东西~
学着写了个demo,其中写了个Select(算是服务吧),但不知怎样调用~,总是提示下面的错误(附后);哪位老大指点一下~,给个调用webservice的调用代码最好,不胜感激~就调用系统生成的那个“helloworld”就行~要c#winform的~~~
对了~偶调用时建的是移动设备的工程~汗ing~在线~ing
关调用实时(JIT)调试而不是此对话框的详细信息,
请参阅此消息的结尾。
************** 异常文本 **************
System.InvalidOperationException: 无法反射方法 Service1.Select。 ---> 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 = C:\Documents and Settings\Administrator\My Documents\Visual Studio Projects\SmartDeviceApplication1\bin\Release\
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:\WINNT\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:///C:/Documents and Settings/Administrator/My Documents/Visual Studio Projects/SmartDeviceApplication1/bin/Release/System.Web.Services.DLL.
LOG: Attempting download of new URL file:///C:/Documents and Settings/Administrator/My Documents/Visual Studio Projects/SmartDeviceApplication1/bin/Release/System.Web.Services/System.Web.Services.DLL.
LOG: Attempting download of new URL file:///C:/Documents and Settings/Administrator/My Documents/Visual Studio Projects/SmartDeviceApplication1/bin/Release/System.Web.Services.EXE.
LOG: Attempting download of new URL file:///C:/Documents and Settings/Administrator/My Documents/Visual Studio Projects/SmartDeviceApplication1/bin/Release/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 SmartDeviceApplication1.Service.Service1..ctor()
at SmartDeviceApplication1.Form1.button1_Click(Object sender, EventArgs e)
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)
************** 已加载的程序集 **************
mscorlib
程序集版本: 1.0.5000.0
Win32 版本: 1.1.4322.573
基本代码: file:///c:/winnt/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
SmartDeviceApplication1
程序集版本: 1.0.2455.20765
Win32 版本: 1.0.2455.20765
基本代码: file:///C:/Documents%20and%20Settings/Administrator/My%20Documents/Visual%20Studio%20Projects/SmartDeviceApplication1/bin/Release/SmartDeviceApplication1.exe
----------------------------------------
System.Windows.Forms
程序集版本: 1.0.5000.0
Win32 版本: 1.1.4322.573
基本代码: file:///c:/winnt/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
程序集版本: 1.0.5000.0
Win32 版本: 1.1.4322.573
基本代码: file:///c:/winnt/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
System.Drawing
程序集版本: 1.0.5000.0
Win32 版本: 1.1.4322.573
基本代码: file:///c:/winnt/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
System.Web.Services
程序集版本: 1.0.5000.0
Win32 版本: 1.1.4322.573
基本代码: file:///c:/winnt/assembly/gac/system.web.services/1.0.5000.0__b03f5f7f11d50a3a/system.web.services.dll
----------------------------------------
System.Xml
程序集版本: 1.0.5000.0
Win32 版本: 1.1.4322.573
基本代码: file:///c:/winnt/assembly/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.dll
----------------------------------------
System.Web
程序集版本: 1.0.5000.0
Win32 版本: 1.1.4322.573
基本代码: file:///c:/winnt/assembly/gac/system.web/1.0.5000.0__b03f5f7f11d50a3a/system.web.dll
----------------------------------------
System.Web.Services.resources
程序集版本: 1.0.5000.0
Win32 版本: 1.1.4322.573
基本代码: file:///c:/winnt/assembly/gac/system.web.services.resources/1.0.5000.0_zh-chs_b03f5f7f11d50a3a/system.web.services.resources.dll
----------------------------------------
System.Windows.Forms.resources
程序集版本: 1.0.5000.0
Win32 版本: 1.1.4322.573
基本代码: file:///c:/winnt/assembly/gac/system.windows.forms.resources/1.0.5000.0_zh-chs_b77a5c561934e089/system.windows.forms.resources.dll
----------------------------------------
mscorlib.resources
程序集版本: 1.0.5000.0
Win32 版本: 1.1.4322.573
基本代码: file:///c:/winnt/assembly/gac/mscorlib.resources/1.0.5000.0_zh-chs_b77a5c561934e089/mscorlib.resources.dll
----------------------------------------
************** JIT 调试 **************
计算机的配置文件(machine.config)的
system.windows.forms 节中必须设置 jitDebugging 值。
编译应用程序时还必须启用\r\n调试。\r\n\r\n例如: \r\n\r\n<configuration>\r\n <system.windows.forms jitDebugging="true" />\r\n</configuration>\r\n\r\n启用 JIT 调试后,任何未处理的异常\r\n都将被发送到此计算机上注册的 JIT 调试器,\r\n而不是由此对话框处理。\r\n