c# - wcf restful service method input parameter: string vs stream -


can explain me? difference between wcf methods string , stream input parameters?

void method1(stream input) , void method2(string input)

when 1 should use stream input parameter? benefits , disadvantages , limits each of these approaches?

thank much.

you'd use stream parameter if want receive bytes incoming http request body in operation. that's "raw" mode mentioned @ http://blogs.msdn.com/b/carlosfigueira/archive/2008/04/17/wcf-raw-programming-model-receiving-arbitrary-data.aspx, , can use receive arbitrary data.

you'd use string parameter if want receive well-formatted string in of supported formats. out of box, means either json (the string value surrounded ") or xml (depending on body style of operation, either xml element node called <string> text value passed operation, or element name of operation, child element named parameter, child text node value passed operation.


Comments

Popular posts from this blog

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

wordpress - (T_ENDFOREACH) php error -

delphi - cxGrid : instead of "go to next cell on enter" using "enter" do that with the arrow keys -