c# - Sending and receiving SOAP messages -


I am writing a web service client in C # and do not want to create and serialize / deserize objects Rather, sending them and receiving them is the raw XML

Is it possible in C #?

Here is a part of an implementation based on the example of John M. Gant. Setting the Content Type Request Header is important, besides my request, credentials are required.

  Protected Virtual WebQuest Contrast (ISO Message Message Soap Message) {var wr = WebRequest.Create (soapMessage.Uri); Wr.ContentType = "text / xml; charset = UTF-8"; Wr.ContentLength = soapMessage.ContentXml.Length; Wr.Headers.Add ("SOAPAction", Soap Message SoapAction); Wr.Credentials = Soap Message Credentials; Wr.Method = "post"; Wr.GetRequestStream (). Write (encoding. UTF8.GetBytes (soapMessage.ContentXml), 0, soapMessage.ContentXml.Length); Return return; } Public Interface ISoapMessage {string URI {get; } String ContentXml {get; } String SoapEction {Receive; } {Receive ICredentials credentials; }}  

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -