Note that there are some explanatory texts on larger screens.

plurals
  1. POGetting a FaultException when trying to work with a WCF service
    primarykey
    data
    text
    <p>EDIT: Here's my call stack.</p> <blockquote> <p>System.ServiceModel.dll!System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(System.ServiceModel.Channels.Message reply, System.ServiceModel.Channels.MessageFault fault, string action, System.ServiceModel.Channels.MessageVersion version, System.ServiceModel.Channels.FaultConverter faultConverter) + 0x124 bytes<br> System.ServiceModel.dll!System.ServiceModel.Channels.ServiceChannel.HandleReply(System.ServiceModel.Dispatcher.ProxyOperationRuntime operation, ref System.ServiceModel.Dispatcher.ProxyRpc rpc) + 0x147 bytes<br> System.ServiceModel.dll!System.ServiceModel.Channels.ServiceChannel.EndCall(string action, object[] outs, System.IAsyncResult result) + 0xb2 bytes<br> System.ServiceModel.dll!System.ServiceModel.ClientBase.ChannelBase.EndInvoke(string methodName, object[] args, System.IAsyncResult result) + 0x1e bytes<br> PhoneClient.dll!PhoneClient.ServiceReference1.Service1Client.Service1ClientChannel.EndGetFirstAidGuides(System.IAsyncResult result) Line 420 C# PhoneClient.dll!PhoneClient.ServiceReference1.Service1Client.PhoneClient.ServiceReference1.IService1.EndGetFirstAidGuides(System.IAsyncResult result) Line 284 + 0x7 bytes C# PhoneClient.dll!PhoneClient.ServiceReference1.Service1Client.OnEndGetFirstAidGuides(System.IAsyncResult result) Line 292 + 0x2 bytes C# System.ServiceModel.dll!System.ServiceModel.ClientBase.OnAsyncCallCompleted(System.IAsyncResult result) + 0x20 bytes<br> System.ServiceModel.dll!System.ServiceModel.AsyncResult.Complete(bool completedSynchronously) + 0x66 bytes<br> System.ServiceModel.dll!System.ServiceModel.AsyncResult.Complete(bool completedSynchronously, System.Exception exception) + 0xe bytes<br> System.ServiceModel.dll!System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.CallComplete(bool completedSynchronously, System.Exception exception) + 0x8 bytes<br> System.ServiceModel.dll!System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.FinishSend(System.IAsyncResult result, bool completedSynchronously) + 0x99 bytes<br> System.ServiceModel.dll!System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.SendCallback(System.IAsyncResult result) + 0x1a bytes<br> System.ServiceModel.dll!System.ServiceModel.AsyncResult.Complete(bool completedSynchronously) + 0x66 bytes<br> System.ServiceModel.dll!System.ServiceModel.AsyncResult.Complete(bool completedSynchronously, System.Exception exception) + 0xe bytes<br> System.ServiceModel.dll!System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.OnGetResponse(System.IAsyncResult result) + 0x52 bytes<br> System.Windows.dll!System.Net.Browser.ClientHttpWebRequest.InvokeGetResponseCallback.AnonymousMethod__8(object state2) + 0x1b bytes mscorlib.dll!System.Threading.ThreadPool.WorkItem.WaitCallback_Context(object state) + 0x18 bytes<br> mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x63 bytes<br> mscorlib.dll!System.Threading.ThreadPool.WorkItem.doWork(object o) + 0x47 bytes mscorlib.dll!System.Threading.Timer.ring() + 0x70 bytes </p> </blockquote> <p>And the error: The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.</p> <p>I'm currenntly working on a Windows Phone 7 application in which I am communicating with a WCF service. I've made it work within one method already. So I that it is possible.</p> <p>Here is my class that calls the WCF service</p> <pre><code>public partial class FirstAidGuides : PhoneApplicationPage { public FirstAidGuides() { InitializeComponent(); ServiceReference1.Service1Client sc = new ServiceReference1.Service1Client(); sc.GetFirstAidGuidesCompleted += new EventHandler&lt;ServiceReference1.GetFirstAidGuidesCompletedEventArgs&gt;(sc_GetFirstAidGuidesCompleted); sc.GetFirstAidGuidesAsync(); } void sc_GetFirstAidGuidesCompleted(object sender, ServiceReference1.GetFirstAidGuidesCompletedEventArgs e) { FirstAidGuideText.Text = e.Result[0].Text; } } </code></pre> <p>Right now, I'm just trying to get some text written in a textblock, from my result.</p> <p>This is the interface of the WCF service.</p> <pre><code>[ServiceContract] public interface IService1 { [OperationContract] long CreateCall(string phoneNumber, double longtitude, double langtitude); [OperationContract] List&lt;Model.FirstAidGuide&gt; GetFirstAidGuides(); } </code></pre> <p>The method of my service class, that pulls data from a database.</p> <pre><code>public List&lt;Model.FirstAidGuide&gt; GetFirstAidGuides() { DataClasses1DataContext db = new DataClasses1DataContext(); var firstAidGuides = (from f in db.FirstAidGuides select f); List&lt;Model.FirstAidGuide&gt; list = new List&lt;Model.FirstAidGuide&gt;(); foreach (var guide in firstAidGuides.ToList()) { Model.FirstAidGuide fa = new Model.FirstAidGuide(); fa.FirstAidId = guide.FirstAidId; fa.Title = guide.FirstAidTitle; fa.Text = guide.FirstAidText; fa.LastUpdated = (DateTime)guide.LastUpdated; list.Add(fa); } return list; } </code></pre> <p>And just for convenience. The FirstAidGuide class.</p> <pre><code>[DataContract] public class FirstAidGuide { [DataMember] private string _title; [DataMember] private string _text; [DataMember] private DateTime _lastUpdated; [DataMember] private long _firstAidId; public long FirstAidId { get { return _firstAidId; } set { _firstAidId = value; } } public DateTime LastUpdated { get { return _lastUpdated; } set { _lastUpdated = value; } } public string Text { get { return _text; } set { _text = value; } } public string Title { get { return _title; } set { _title = value; } } } </code></pre> <p>I simply cannot get it to do anything. I'm getting a FaultException, which points me in the direction that it cannot handle the response from the WCF service.</p> <p>Any help would be appreciated.</p>
    singulars
    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.
 

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