WebException: The server committed a protocol violation. Section = ResponseStatusLine (call the Marketo SOAP API)

I am trying to call Marketo SOAP Webservice through ASP.NET/C#. I successfully added a link to a web service and tried to call it using this line of code:

SuccessGetLead lead = service.getLead(paramsgetlead);

The problem is that 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 (parameters String methodName, Object []) +172

com.marketo.soap.MktMktowsApiService.getLead (ParamsGetLead paramsGetLead) in c: \ Users \ hubert.grininger \ AppData \ Local \ Temp \ Temporary ASP.NET files \ dynaweb2007 \ 82e21235 \ d41bf12a \ App_Webruc.ferences.qik CS: 206

_test_marketo.Page_Load (object sender, EventArgs e) at 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 to add

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

but that didn't help either.

, Marketo, .

.

+3
2

. , wsdl ( Marketo) localhost webservice. URL WebServiceObject.Url, .

+4

HTTP/1.0 HTTP/1.1

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

: -)

+3

Source: https://habr.com/ru/post/1776924/


All Articles