System.Web.Services.Protocols.SoapClientType..ctor中的NullReferenceException(System.Type类型) [英] NullReferenceException in System.Web.Services.Protocols.SoapClientType..ctor (System.Type type)

查看:46
本文介绍了System.Web.Services.Protocols.SoapClientType..ctor中的NullReferenceException(System.Type类型)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Ubuntu上运行我的应用程序,但出现以下错误

I am trying to run my application on Ubuntu but getting following error

System.NullReferenceException:对象引用未设置为对象的实例
 在< 4493f371b365451c969f031cecf97807>中的System.Web.Services.Protocols.SoapClientType..ctor(系统类型类型)[0x00115]:0 
 在< 4493f371b365451c969f031cecf97807>中的System.Web.Services.Protocols.SoapHttpClientProtocol..ctor()[0x00055]:0 
 在< 9ae2e43a5c144c0ca0991f9abd1a3f28>中的WebAstra.Shared.Authentication.WebService.AuthenticationService..ctor()[0x00000]:0 
 在(包装器带有检查的远程调用)WebAstra.Shared.Authentication.WebService.AuthenticationService:.ctor()
 在< 9ae2e43a5

System.NullReferenceException: Object reference not set to an instance of an object
  at System.Web.Services.Protocols.SoapClientType..ctor (System.Type type) [0x00115] in <4493f371b365451c969f031cecf97807>:0 
  at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor () [0x00055] in <4493f371b365451c969f031cecf97807>:0 
  at WebAstra.Shared.Authentication.WebService.AuthenticationService..ctor () [0x00000] in <9ae2e43a5c144c0ca0991f9abd1a3f28>:0 
  at (wrapper remoting-invoke-with-check) WebAstra.Shared.Authentication.WebService.AuthenticationService:.ctor ()
  at WebAstra.Shared.Authentication.Utils.AuthHelper.InitializeService (System.Net.IWebProxy webProxy, System.String loginUrl) [0x00021] in <9ae2e43a5

这是我的代码

AuthenticationService = newAuthenticationService {Proxy = webProxy, Url = LoginUrl};

以上代码在Windows中可以正常工作

当作为程序单独运行时,在Ubuntu中也可以正常工作.

When runs seprately as a program also works fine in Ubuntu.

从其他项目中调用时,抛出上述错误Ubuntu,可以在Windows中正常工作

When called from other project throwing above error in Ubuntu and working fine in Windows

推荐答案

你好,尼克尔,

Hi Nikhil,

要从其他类文件或项目中调用,您需要创建一个要访问的对象.

In order to call from other class file or project you need to create an object to access.

AuthenticationService auth = new AuthenticationService {Proxy = webProxy, Url = LoginUrl};

然后使用该auth对象.希望对您有帮助.

Then use that auth object. Hope this helps you.


这篇关于System.Web.Services.Protocols.SoapClientType..ctor中的NullReferenceException(System.Type类型)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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