问题描述
我试图调用的Marketo SOAP的Webservice
通过ASP.NET / C#。
我成功添加Web服务引用,并试图与这条线code来调用它:
I'm trying to call the Marketo SOAP Webservicevia 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
我也尝试添加
<system.net>
<settings>
<httpWebRequest useUnsafeHeaderParsing = "true" />
</settings>
</system.net>
但没有帮助。
我想请求永远不会发送到的Marketo但错误已经发生在我的结束。
I think the request is never sent to Marketo but the error already occurs on my end.
感谢任何帮助或提示。
Thanks for any help or hint.
推荐答案
解决。问题是,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.
这篇关于引发WebException:服务器犯了违反协议。第= ResponseStatusLine(调用的Marketo SOAP API)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!