<p>I have a .net web application that has a Flex application embedded within a page. This flex application calls a .net webservice. I can trace the execution proccess through the debugger and all looks great until I get the response:</p>

<pre><code>


soap:ReceiverSystem.Web.Services.Protocols.SoapException: Server was unable to process request

. ---&gt; System.Xml.XmlException: Root element is missing.

   at System.Xml.XmlTextReaderImpl.Throw(Exception e)

   at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res)

   at System.Xml.XmlTextReaderImpl.ParseDocumentContent()

   at System.Xml.XmlTextReaderImpl.Read()

   at System.Xml.XmlTextReader.Read()

   at System.Web.Services.Protocols.SoapServerProtocol.SoapEnvelopeReader.Read()

   at System.Xml.XmlReader.MoveToContent()

   at System.Web.Services.Protocols.SoapServerProtocol.SoapEnvelopeReader.MoveToContent()

   at System.Web.Services.Protocols.SoapServerProtocolHelper.GetRequestElement()

   at System.Web.Services.Protocols.Soap12ServerProtocolHelper.RouteRequest()

   at System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage message)

   at System.Web.Services.Protocols.SoapServerProtocol.Initialize()

   at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest

 request, HttpResponse response, Boolean&amp; abortProcessing)

   --- End of inner exception stack trace ---
</code>
</pre>

<p>The call from flex looks good, the execution through the webservice is good, but this is the response I capture via wireshark, what is going on here?</p>

<p>I have tried several web methods, from "Hello World" to paramatized methods...all comeback with the same response...</p>

<p>I thought it may have something to do with encoding with the "---&amp;gt", but I'm unsure how to control what .net renders as the response.</p>

[{'answer_id': 15292, 'author': 'James Avery', 'author_id': 537, 'author_profile': 'https://Stackoverflow.com/users/537', 'pm_score': 1, 'selected': False, 'text': '<p>It looks like you might be sending a poorly formed XML document to the service. Can you use Fiddler or something like that to get a copy of the actual call that is going to the web service? That would be a huge help in figured out what the issue is.</p>\n'}, {'answer_id': 78733, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': "<p>Are you using Flex 3?  If so, you can set a breakpoint when the webservice is executed and actually step through the Flex framework as it encodes your request.  Look in mx.rpc.soap.SoapEncoder and you'll be able to see exactly what is going to be sent over the wire.  </p>\n"}, {'answer_id': 145239, 'author': 'Brandon', 'author_id': 23133, 'author_profile': 'https://Stackoverflow.com/users/23133', 'pm_score': 1, 'selected': False, 'text': '<p>I recently used a .NET REST interface which I consumed using a Flex app. I got some strange exceptions as well and my issue was that I forgot to include in xmlns (the namespace) in the root element when sending requests. This is a wild guess but I hope it helps.</p>\n'}]
['https://Stackoverflow.com/questions/13775', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1638/']