SoapHttpClientProtocol: get response as stream instead of string?

I use a webservice that spills out very large amounts of data in one piece. The response line may be something like 8 MB. Although this is not a problem on the desktop PC, the onboard device has nuts dealing with an 8 megabyte string object.

I wonder if there is a way to get the answer as a stream? I am currently using a method as shown below. Instead, I tried using a POST request, but SOAP is just more convenient (XML response and with POST I need to convert the plain text response back to valid XML) and I would like to stick with it. Can I use a different type of "Invoke" that will not return rows other than streams? Any ideas?

[System.Web.Services.Protocols.SoapDocumentMethodAttribute("MyAPI/MyMethod", RequestNamespace="MyAPI", ResponseNamespace="MyAPI", ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
    public string MyMethod(string sID)
    {
      object[] results = this.Invoke("MyMethod", new object[] { sID });
      return ((string)(results[0]));
    }
+3
source share
4

- ASMX, . , , .

, GetWebResponse, WebResponse. , , GetResponseStream , , , "", - ( .NET ).

- , GetReaderForMessage. SoapClientMessage, Stream, , , . , , -.

WCF. WCF .

WCF. , .

+1

- SOAP, ? , , . , , ?

+1

, , SOAP.

, - :

  • , .
  • arraylist GUID.

GUID, -.

+1
+1

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


All Articles