0

我正在使用来自https://wwwcie.ups.com/ups.app/xml/Rate的 Web 服务将 UPS 运输计算合并到我的 asp.net 项目中。在运行项目时,我遇到了如下异常:

说明:System.Web.Services.Protocols.SoapException:服务器无法识别 HTTP 标头 SOAPAction 的值:http://localhost:4594/ShippingModule.asmx/GetUPSShippingCost。在 System.Web.Services.Protocols.Soap11ServerProtocolHelper.RouteRequest() 在 System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage 消息) 在 System.Web.Services.Protocols.SoapServerProtocol.Initialize() 在 System.Web.Services .Protocols.ServerProtocol.SetContext(Type type, HttpContext context, HttpRequest request, HttpResponse response) at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing) Source: System 。网页服务

我现在在 localhost 中运行它。这是这个异常的来源吗?还是 Web 服务中使用的自定义命名空间是主要问题?我在网上搜索了很多这个问题。但是没有办法解决这个问题。

4

1 回答 1

2

@用户286035,

异常本身很清楚,Server没有识别HTTP Header SOAPAction的值

这意味着您发送的肥皂信封有一个标头,其中包含服务器无法识别的元素 SOAPAction。如果需要 SOAPAction 元素,则尝试在其中放入适当的值,然后将其发布到 SOAP 服务。

使用 TCPMonitor 监控正在发送到服务器的请求,它将为您提供一个清晰的思路。

于 2012-01-07T07:16:17.487 回答