我已經嘗試過每個組合都發送一個請求,以從jQuery向RESTful WCF發送POST請求。使用json發送Post請求到RESTful WCF
有人可以模仿並使其工作。代碼在這裏:http://pastebin.com/Ua97919C
我與過去2年的WCF一起工作,但每次發送POST請求都會讓我苦不堪言。
我努力使它從過去4天開始工作,並經歷了至少35-40個帖子。
最終,這個請求將從iPhone發送到WCF。
當我用Fiddler檢查時,錯誤主要是:*服務器在處理請求時遇到錯誤。異常消息是'傳入消息具有意外的消息格式'原始'。預期的操作消息格式是'Xml','Json'。這可能是因爲WebContentTypeMapper尚未在綁定中配置。有關更多詳細信息,請參閱WebContentTypeMapper的文檔。'。查看服務器日誌獲取更多詳細信異常堆棧跟蹤是: 在
System.ServiceModel.Dispatcher.DemultiplexingDispatchMessageFormatter.DeserializeRequest(Message message, Object[] parameters)
at System.ServiceModel.Dispatcher.UriTemplateDispatchFormatter.DeserializeRequest(Message message, Object[] parameters)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.DeserializeInputs(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
否..然後在jQuery.min.js上拋出錯誤。我早些時候也嘗試過。 – iMatoria 2011-12-16 17:22:35
我已嘗試/重試兩個。 – iMatoria 2011-12-16 17:31:03