简体   繁体   English

SoapException Server无法在MVC站点中处理ASMX Web服务上的请求

[英]SoapException Server was unable to process request on ASMX webservice in MVC site

I'm getting an exception when trying to access an .asmx webservice within a MVC site. 我在尝试访问MVC站点中的.asmx webservice时遇到异常。 I've tried numerous things like updating the web reference within the console application and building another quick app to test, but can't get passed this issue. 我已经尝试了很多东西,例如在控制台应用程序中更新Web引用并构建另一个快速应用程序来测试,但无法通过此问题。 If I pull the URL out of the svc variable, I can browse to it directly. 如果我从svc变量中提取URL,我可以直接浏览它。

Exception Details 例外细节

System.Web.Services.Protocols.SoapException occurred Message=Server was unable to process request. System.Web.Services.Protocols.SoapException发生Message = Server无法处理请求。 ---> Value cannot be null. --->值不能为空。 Parameter name: uriString 参数名称:uriString
Source=System.Web.Services Actor="" Lang="" Node="" Role="" Source = System.Web.Services Actor =“”Lang =“”Node =“”Role =“”
StackTrace: at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at ClarityIntegration.SendTrackerDataToClarity() in [REDACTED].Reference.cs:line 78 at [REDACTED].Program.Main(String[] args) in [REDACTED].Program.cs:line 33 StackTrace:在System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage消息,WebResponse响应,Stream responseStream,Boolean asyncCall)处于ClarityIntegration的System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName,Object [] parameters)中。[删除] .Reference.cs中的.SendTrackerDataToClarity():[删除]中的第78行。[删除]中的.Program.Main(String [] args).Program.cs:第33行
InnerException: 的InnerException:

CONSOLE APP CODE CONSOLE APP代码

var svc = new TrackerClarityService.ClarityIntegration()
    {
        Url = url,
        Credentials =
            new System.Net.NetworkCredential("user", "pass", "domain")
    };
svc.SendTrackerDataToClarity();
svc.Dispose(); 

Issue Resolved 问题解决了

The exception was coming out of the Web Service itself. Web服务本身就是例外。 There were some global variables not being initialized directly through the .asmx call that were being initialized by the application itself. 有些全局变量没有通过.asmx调用直接初始化,而是由应用程序本身初始化。

Some simple checks on variables within the Web Service and setting what needs to be set have fixed up the issue. 对Web Service中的变量进行一些简单的检查并设置需要设置的内容已经解决了这个问题。

Issue Resolved 问题解决了

The exception was coming out of the Web Service itself. Web服务本身就是例外。 There were some global variables not being initialized directly through the .asmx call that were being initialized by the application itself. 有些全局变量没有通过.asmx调用直接初始化,而是由应用程序本身初始化。

Some simple checks on variables within the Web Service and setting what needs to be set have fixed up the issue. 对Web Service中的变量进行一些简单的检查并设置需要设置的内容已经解决了这个问题。

If using basic auth, this has solved my issues in the past: 如果使用基本身份验证,这已经解决了我过去的问题:

NetworkCredential nc = new NetworkCredential();
nc.Domain = "domain"
nc.UserName = "user"
nc.Password = "pwd"

Uri uri = new Uri(svc.Url);
ICredentials credentials = nc.GetCredential(uri, "Basic");
svc.Credentials = credentials;

Captain here, this is the message when a WebReference has been instantiated, but has no URL defined or the given URL is null, and a method ist called. 在这里上尉,这是实例化WebReference时的消息,但没有定义URL或给定的URL为null,并且调用了一个方法。 The origin of an empty URL could be a missing value in a app/web.config file. 空URL的来源可能是app / web.config文件中缺少的值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SoapException:服务器无法读取请求 - SoapException: Server was unable to read request 来自Asmx Web服务的WCF客户端捕获SoapException - WCF Client Catching SoapException from asmx webservice System.Web.Services.Protocols.SoapException:服务器无法处理请求。 ---> System.ArgumentNullException - System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.ArgumentNullException Windows 2008 R2企业版问题(消息:System.Web.Services.Protocols.SoapException:服务器无法处理请求) - Windows 2008 R2 Enterprise Edition Issues(Message:System.Web.Services.Protocols.SoapException: Server was unable to process request) Web服务器上的后台进程与ASMX Webservice - Background process on webserver with an ASMX Webservice 接受带有 Web 服务 (asmx) 的 json 请求 - Accepting a json request with a Webservice (asmx) 服务器无法处理请求 - Server was unable to process request ASMX WebService在LIVE服务器上不起作用 - ASMX WebService not working on LIVE server Webservice + consumer c#error服务器无法处理请求。 --->连接已经打开 - Webservice+consumer c# error Server was unable to process request. ---> The connection is already open 捕获WebService抛出的SoapException - Catching a SoapException thrown by a WebService
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM