【发布时间】:2013-02-12 22:03:29
【问题描述】:
错误详情:System.ServiceModel.ProtocolException:远程 服务器返回意外响应:(400) 错误请求。 ---> System.Net.WebException:远程服务器返回错误:(400) 错误的请求。在 System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
在 System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult 结果)---内部异常堆栈跟踪结束---服务器堆栈跟踪:在 System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult 结果)
在 System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult 结果)在 System.ServiceModel.Channels.ServiceChannel.EndCall(字符串动作, Object[] 输出,IAsyncResult 结果)在 System.ServiceModel.Channels.ServiceChannel.EndRequest(IAsyncResult 结果)在 [0] 处重新抛出异常:在 System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg,IMessage retMsg)在 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(消息数据& msgData,Int32 类型)在 System.ServiceModel.Channels.IRequestChannel.EndRequest(IAsyncResult 结果)在 Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.RequestCallback(IAsyncResult 结果)MessageId:{656781BB-FFA0-466B-A001-83ADCD4EEB78}
使用 BasicHTTPbindings...没有登录凭据。在使用其他 WCF 测试工具进行测试时工作。
【问题讨论】:
-
.asmx用于ASP.Net网络服务,.svc用于WCF网络服务。两者是不同的。对于您不能使用 WCF 客户端调用 .asmx Web 方法,我并不感到惊讶。你确定这应该有效吗? -
您可以从 WCF 客户端调用 .asmx 服务。它应该使用 BasicHTTP 绑定。我今天正在这样做,没有任何问题。我在这里缺少的是远程错误。我怀疑这是一个糟糕的 SOAP 请求。如果您调试远程 asmx 服务并在您的 Web 方法的第一行放置一个断点,那么调用是否使其进入断点?如果不是,则调用格式不正确,IIS 正在捕获它并返回错误请求,因为调用的签名与 Web 方法的签名不匹配。方法中的错误应返回 50x。
-
使用 HTTP Fiddler 看看当您使用 WCF 测试工具调用 Web 服务时会发生什么,它在哪里工作,并在从 Biztalk 调用时进行比较。它应该会给你一个线索。
标签: biztalk