Note that there are some explanatory texts on larger screens.

plurals
  1. POData at root level is invalid. working with ajax wcf service, and cant figure it out
    primarykey
    data
    text
    <p>I am not sure what this means to me. I been picking at it over the last day or 2. I have other functions which work with "GET" but this is the first "POST" hit in the process chain. Does anyone have an idea whats wrong?</p> <p>Error Output:</p> <pre><code>{"ExceptionDetail":{ "HelpLink":null, "InnerException":{ "HelpLink":null, "InnerException":null, "Message":"The data at the root level is invalid. Line 1, position 1.", "StackTrace":" at System.Xml.XmlExceptionHelper.ThrowXmlException(XmlDictionaryReader reader, String res, String arg1, String arg2, String arg3)\u000d\u000a at System.Xml.XmlUTF8TextReader.Read()\u000d\u000a at System.Xml.XmlBaseReader.IsStartElement()\u000d\u000a at System.Xml.XmlBaseReader.IsStartElement(XmlDictionaryString localName, XmlDictionaryString namespaceUri)\u000d\u000a at System.ServiceModel.Dispatcher.PrimitiveOperationFormatter.DeserializeRequest(XmlDictionaryReader reader, Object[] parameters)\u000d\u000a at System.ServiceModel.Dispatcher.PrimitiveOperationFormatter.DeserializeRequest(Message message, Object[] parameters)", "Type":"System.Xml.XmlException"}, "Message":"The formatter threw an exception while trying to deserialize the message: Error in deserializing body of request message for operation 'SaveXml'. The data at the root level is invalid. Line 1, position 1.", "StackTrace":" at System.ServiceModel.Dispatcher.PrimitiveOperationFormatter.DeserializeRequest(Message message, Object[] parameters)\u000d\u000a at System.ServiceModel.Dispatcher.DemultiplexingDispatchMessageFormatter.DeserializeRequest(Message message, Object[] parameters)\u000d\u000a at System.ServiceModel.Dispatcher.UriTemplateDispatchFormatter.DeserializeRequest(Message message, Object[] parameters)\u000d\u000a at System.ServiceModel.Dispatcher.CompositeDispatchFormatter.DeserializeRequest(Message message, Object[] parameters)\u000d\u000a at System.ServiceModel.Dispatcher.DispatchOperationRuntime.DeserializeInputs(MessageRpc&amp; rpc)\u000d\u000a at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp; rpc)\u000d\u000a at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp; rpc)\u000d\u000a at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc&amp; rpc)\u000d\u000a at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc&amp; rpc)\u000d\u000a at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&amp; rpc)\u000d\u000a at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc&amp; rpc)\u000d\u000a at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc&amp; rpc)\u000d\u000a at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc&amp; rpc)\u000d\u000a at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc&amp; rpc)\u000d\u000a at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)","Type":"System.ServiceModel.Dispatcher.NetDispatcherFaultException"}, "ExceptionType":"System.ServiceModel.Dispatcher.NetDispatcherFaultException", "Message":"The formatter threw an exception while trying to deserialize the message: Error in deserializing body of request message for operation 'SaveXml'. The data at the root level is invalid. Line 1, position 1.","StackTrace":" at System.ServiceModel.Dispatcher.PrimitiveOperationFormatter.DeserializeRequest(Message message, Object[] parameters)\u000d\u000a at System.ServiceModel.Dispatcher.DemultiplexingDispatchMessageFormatter.DeserializeRequest(Message message, Object[] parameters)\u000d\u000a at System.ServiceModel.Dispatcher.UriTemplateDispatchFormatter.DeserializeRequest(Message message, Object[] parameters)\u000d\u000a at System.ServiceModel.Dispatcher.CompositeDispatchFormatter.DeserializeRequest(Message message, Object[] parameters)\u000d\u000a at System.ServiceModel.Dispatcher.DispatchOperationRuntime.DeserializeInputs(MessageRpc&amp; rpc)\u000d\u000a at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp; rpc)\u000d\u000a at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp; rpc)\u000d\u000a at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc&amp; rpc)\u000d\u000a at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc&amp; rpc)\u000d\u000a at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&amp; rpc)\u000d\u000a at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc&amp; rpc)\u000d\u000a at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc&amp; rpc)\u000d\u000a at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc&amp; rpc)\u000d\u000a at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc&amp; rpc)\u000d\u000a at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)"} </code></pre> <p>CALL:</p> <pre><code>//when stringified, it looks correct. No real obvious holes. //the variables in data are strings, and are recognized correctly in the request payload of the file. var settings = { url: "webservices/FormServices.svc/SaveXml", type: "POST", contentType: "text/xml", data: JSON.stringify({ auth: auth, server: server, datasource: datasource, FileId:FileId, XML:xml }), success: success, error: error }; console.log("Settings", settings); return $.ajax(settings); </code></pre> <p>IService:</p> <pre><code>//this is of a class i made with a [ServiceContract] [OperationContract] [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json)] string SaveXml(string auth, string server, string datasource, string FileId, string XML); </code></pre> <p>Service:</p> <pre><code>public string SaveXml(string auth, string server, string datasource, string FileId, string XML) { string response = "-1"; return response; } </code></pre> <p>Binding:</p> <pre><code>&lt;system.serviceModel&gt; &lt;services&gt; &lt;service name="test.webservices.FormServices" behaviorConfiguration="debug"&gt; &lt;endpoint address="" behaviorConfiguration="test.webservices.FormServicesAspNetAjaxBehavior" binding="webHttpBinding" contract="test.webservices.IFormServices"/&gt; &lt;/service&gt; &lt;/services&gt; &lt;bindings /&gt; &lt;client /&gt; &lt;behaviors&gt; &lt;endpointBehaviors&gt; &lt;behavior name="test.webservices.FromRequestAspNetAjaxBehavior"&gt; &lt;enableWebScript /&gt; &lt;/behavior&gt; &lt;behavior name="test.webservices.FormServicesAspNetAjaxBehavior"&gt; &lt;enableWebScript /&gt; &lt;/behavior&gt; &lt;/endpointBehaviors&gt; &lt;serviceBehaviors&gt; &lt;behavior name="debug"&gt; &lt;serviceMetadata httpGetEnabled="true" /&gt; &lt;serviceDebug includeExceptionDetailInFaults="true" /&gt; &lt;/behavior&gt; &lt;/serviceBehaviors&gt; &lt;/behaviors&gt; &lt;serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /&gt; </code></pre> <p></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload