Web services Web服务尝试给出SoapException,为什么以及怎么做?

Web services Web服务尝试给出SoapException,为什么以及怎么做?,web-services,soap,Web Services,Soap,我学习了使用VisualStudio2008ASP.Net+VB制作web服务的基础知识。我让“Hello World”正常工作,但由于某种原因,我无法得到一个函数方法以同样的方式工作,而没有这个错误,我也无法得到任何关于如何处理它的信息 代码: *网络服务:* _ 公共子日志事件(ByVal userId作为字符串,ByVal userGroup作为字符串) '这里的方法函数 端接头 *主页代码隐藏* 受保护的子webrefTester() Dim testi作为my_dbServer.Ser

我学习了使用VisualStudio2008ASP.Net+VB制作web服务的基础知识。我让“Hello World”正常工作,但由于某种原因,我无法得到一个函数方法以同样的方式工作,而没有这个错误,我也无法得到任何关于如何处理它的信息

代码:

*网络服务:* _ 公共子日志事件(ByVal userId作为字符串,ByVal userGroup作为字符串) '这里的方法函数 端接头 *主页代码隐藏* 受保护的子webrefTester() Dim testi作为my_dbServer.Service testi=新的my_dbServer.Service testi.Credentials=System.Net.CredentialCache.DefaultCredentials '必须包括这一点,因为我使用URL而不是本地来模拟 '预期的功能,因此最初存在授权问题 testi.logEvent(“用户ID_0”,“管理服务2010”) 端接头 如前所述,hello world运行良好,因此我将web引用添加到需要使用web服务的解决方案中,等等。我似乎无法为web服务传递参数,它总是抛出soapexception。我需要它来将信息记录到数据库中

对于第一次使用web服务的用户,任何其他提示都是受欢迎的。基本上,我的项目让我做一项服务,可以用于各种软件来记录事件信息,如访客类型、可能的错误消息等


再次感谢

它只是说SoapException,这是错误消息:

“服务器无法处理请求。-->对象引用未设置为对象的实例。”

您可能还需要向我们显示soap异常 *Web Service:* <WebMethod()> _ Public Sub logEvent(ByVal userId As String, ByVal userGroup As String) 'method functions here End Sub *Mainpage Code-behind* Protected Sub webrefTester() Dim testi As my_dbServer.Service testi = New my_dbServer.Service testi.Credentials = System.Net.CredentialCache.DefaultCredentials 'have to include this because i use urls instead of local to simulate 'intended functionality, so there were authorization issues at first testi.logEvent("userId_0", "Mgmt Services 2010") End Sub