In the main code, in order to bypass the default Xml output that would be served by the Web Service method, I have added this code:
Dim loHttpResponse As System.Web.HttpResponse = Nothing
loHttpResponse = System.Web.HttpContext.Current.Response
loHttpResponse.Clear()
loHttpResponse.ClearContent()
loHttpResponse.ClearHeaders()
loHttpResponse.ContentType = "text/xml"
loHttpResponse.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8")
loHttpResponse.Write(cXml)
loHttpResponse.End()
This takes over the response and sends some data.
But, the client says "Response is not well-formed XML."
If I replace the cXml line with:
loHttpResponse.Write("test")
...I can see the client reacting and saying that this has to be text/xml content.
So, somethings get sent. But, something is not properly received on the other end.
Anyone would know what is missing?