WebException:服务器违反了协议。 Section=ResponseStatusLine(调用 Marketo SOAP API)

发布于 2024-10-04 06:00:15 字数 1562 浏览 0 评论 0原文

我正在尝试调用 Marketo SOAP Web 服务 通过 ASP.NET / C#。 我成功添加了 Web 服务引用并尝试使用这行代码调用它:

SuccessGetLead lead = service.getLead(paramsgetlead);

问题是我也遇到此异常:

[WebException:服务器违反了协议。部分=ResponseStatusLine]

System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest请求)+263

System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest请求)+4

System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(字符串方法名,对象[]参数)+172

com.marketo.soap.MktMktowsApiService.getLead(ParamsGetLead paramsGetLead) 在 c:\Users\hubert.grininger\AppData\Local\Temp\Temporary ASP.NET Files\dynaweb2007\82e21235\d41bf12a\App_WebReferences.liqikruc.7 中。 CS:206

_test_marketo.Page_Load(对象发送者,EventArgs e)位于 d:\workspace_c\dynaweb2007_test\marketo.aspx.cs:48

System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp,对象o,对象t,EventArgs e)+14

System.Web.Util.CalliEventHandlerDelegateProxy.Callback(对象发送者,EventArgs e)+35

System.Web.UI.Control.OnLoad(EventArgs e) +99

System.Web.UI.Control.LoadRecursive() +50

System.Web.UI.Page.ProcessRequestMain(布尔 includeStagesBeforeAsyncPoint,布尔 includeStagesAfterAsyncPoint)+627

我也尝试添加

<system.net>
   <settings>
       <httpWebRequest useUnsafeHeaderParsing = "true" />
   </settings>
</system.net> 

,但这也没有帮助。

我认为请求从未发送到 Marketo,但错误已经发生在我这边。

感谢您的任何帮助或提示。

I'm trying to call the Marketo SOAP Webservice
via ASP.NET / C#.
I successfully added the web service reference and tried to call it with this line of code:

SuccessGetLead lead = service.getLead(paramsgetlead);

The problem is I also get this exception:

[WebException: The server committed a protocol violation. Section=ResponseStatusLine]

System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request) +263

System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request) +4

System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +172

com.marketo.soap.MktMktowsApiService.getLead(ParamsGetLead paramsGetLead) in c:\Users\hubert.grininger\AppData\Local\Temp\Temporary ASP.NET Files\dynaweb2007\82e21235\d41bf12a\App_WebReferences.liqikruc.7.cs:206

_test_marketo.Page_Load(Object sender, EventArgs e) in d:\workspace_c\dynaweb2007_test\marketo.aspx.cs:48

System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14

System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35

System.Web.UI.Control.OnLoad(EventArgs e) +99

System.Web.UI.Control.LoadRecursive() +50

System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

I also tried adding

<system.net>
   <settings>
       <httpWebRequest useUnsafeHeaderParsing = "true" />
   </settings>
</system.net> 

but that didn't help either.

I think the request is never sent to Marketo but the error already occurs on my end.

Thanks for any help or hint.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

瑾夏年华 2024-10-11 06:00:15

解决了。问题是 wsdl(由 Marketo 提供)错误地将 localhost 指向作为 Web 服务端点。
我通过 WebServiceObject.Url 属性以编程方式设置 URL,现在它可以工作了。

Solved. Problem was that the wsdl (provided by Marketo) wrongly pointed to localhost as webservice endpoint.
I programmatically set the URL via WebServiceObject.Url property and it works now.

羁客 2024-10-11 06:00:15

只需尝试使用 HTTP/1.0 而不是 HTTP/1.1

看看下面的代码

objWebRequest.ProtocolVersion = System.Net.HttpVersion.Version10;

它对我有用;-)

Just try to use HTTP/1.0 instead of HTTP/1.1

look at the following code

objWebRequest.ProtocolVersion = System.Net.HttpVersion.Version10;

It worked for me ;-)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文