Async webrequest times out => Crashes IIS - c#

I've got a web app, that gets data from external services. The request itself happens like the code below - quite straightforward as far as I can see. Create a request, fire it away asynchronously and let the callback handle the response. Works fine on my dev environment.
public static void MakeRequest(Uri uri, Action<Stream> responseCallback)
{
WebRequest request = WebRequest.Create(uri);
request.Proxy = null;
request.Timeout = 8000;
try
{
Task.Factory.FromAsync<WebResponse>(request.BeginGetResponse, request.EndGetResponse, null)
.ContinueWith(task =>
{
WebResponse response = task.Result;
Stream responseStream = response.GetResponseStream();
responseCallback(response.GetResponseStream());
responseStream.Close();
response.Close();
});
} catch (Exception ex)
{
_log.Error("MakeRequest to " + uri + " went wrong.", ex);
}
}
However external test environments and the production environment could, for reasons beyond me, not reach the target URL. Fine, I thought - a request timeout won't really hurt anyone. However, it seemed that every time this request timed out, ASP.NET crashed and IIS was restarted. The event log shows me, among other things, this stacktrace:
StackTrace: at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task`1.get_Result()
at MyApp.AsyncWebClient.<>c__DisplayClass2.<MakeRequest>b__0(Task`1 task)
at System.Threading.Tasks.Task`1.<>c__DisplayClass17.<ContinueWith>b__16(Object obj)
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
InnerException: System.Net.WebException
Message: Unable to connect to the remote server
StackTrace: at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endMethod, TaskCompletionSource`1 tcs)
InnerException: System.Net.Sockets.SocketException
Message: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
StackTrace: at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
..so it all boils down to a SocketException, it seems to me. And right afterwards (within the same second) another event (which I'm guessing is relevant) is logged:
Exception Info: System.AggregateException
Stack:
at System.Threading.Tasks.TaskExceptionHolder.Finalize()
This is sort of beyond me as I'm no master of async code and threading, but that a timeout from a web requests causes IIS to crash seems very weird. I reimplemented MakeRequest to perform the requests synchronously, which works out great. The request still times out in those environments, but no damage is done and the app continues to run happily forever after.
So I've sortof solved my problem, but why does this happen? Can anyone enlighten me? :-)

Your continuation needs to handle the fact that .Result might reflect an exception. Otherwise you have an unhandled exception. Unhandled exceptions kill processes.
.ContinueWith(task =>
{
try {
WebResponse response = task.Result;
Stream responseStream = response.GetResponseStream();
responseCallback(responseStream);
responseStream.Close();
response.Close();
} catch(Exception ex) {
// TODO: log ex, etc
}
});
your old exception handler only covers the creation of the task - not the callback.

Related

HttpClient.GetAsync() gives an AggregateException while fetching data on Azure Function

I am trying to fetch Employee data from Zoho using the URL :
https://people.zoho.com/people/api/forms/P_EmployeeView/records
using the HttpClient's GetAsync(). While executing the code in my local dev environment the code runs smoothly and fetches the required data but as soon as I publish my code to the azure function I get an exception with the following stack trace :
2021-06-01T06:14:45.870 [Error] System.AggregateException: One or more errors occurred. (One or
more errors occurred. (A connection attempt failed because the connected party did not properly
respond after a period of time, or established connection failed because connected host has failed
to respond.))---> System.AggregateException: One or more errors occurred. (A connection attempt
failed because the connected party did not properly respond after a period of time, or established
connection failed because connected host has failed to respond.)--->
System.Net.Http.HttpRequestException: A connection attempt failed because the connected party did
not properly respond after a period of time, or established connection failed because connected
host has failed to respond.---> System.Net.Sockets.SocketException (10060): A connection attempt
failed because the connected party did not properly respond after a period of time, or established
connection failed because connected host has failed to respond.at
System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken
cancellationToken)--- End of inner exception stack trace ---at
System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken
cancellationToken)at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request,
Boolean allowHttp2, CancellationToken cancellationToken)at
System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request,
CancellationToken cancellationToken)at
System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request,
CancellationToken cancellationToken)at
System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean
doRequestAuth, CancellationToken cancellationToken)at
System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken
cancellationToken)at System.Net.Http.DiagnosticsHandler.SendAsync(HttpRequestMessage request,
CancellationToken cancellationToken)at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1
sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)--- End of
inner exception stack trace ---at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean
includeTaskCanceledExceptions)at System.Threading.Tasks.Task`1.GetResultCore(Boolean
waitCompletionNotification)at System.Threading.Tasks.Task`1.get_Result()at
EmployeeDataRefresh.ZohoClient.GetEmployeeData(ILogger log) in
C:\Projects\ZohoAttendance\Internal-Automation-and-Power-BI-Dashboard-zoho-employee-data-
update\src\EmployeeDataRefresh\EmployeeDataRefresh\ZohoClient.cs:line 39--- End of inner exception
stack trace ---at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean
includeTaskCanceledExceptions)at System.Threading.Tasks.Task`1.GetResultCore(Boolean
waitCompletionNotification)at System.Threading.Tasks.Task`1.get_Result()at
EmployeeDataRefresh.Trigger.DoRefresh(ILogger log) in C:\Projects\ZohoAttendance\Internal-
Automation-and-Power-BI-Dashboard-zoho-employee-data-
update\src\EmployeeDataRefresh\EmployeeDataRefresh\Trigger.cs:line 68at
EmployeeDataRefresh.Trigger.AutoRefreshEmployeeData(TimerInfo myTimer, ILogger log) in
C:\Projects\ZohoAttendance\Internal-Automation-and-Power-BI-Dashboard-zoho-employee-data-
update\src\EmployeeDataRefresh\EmployeeDataRefresh\Trigger.cs:line 30
Here's my code that fetches the data
using(var httpClient = new HttpClient())
{
httpClient.DefaultRequestHeaders.Authorization
= new AuthenticationHeaderValue("Bearer", _authToken);
Uri myUri = new Uri(_url, UriKind.Absolute);
var response = httpClient.GetAsync(myUri);
log.LogInformation(_authToken);
log.LogInformation("Sending Get Request to Zoho...\n");
var data = await response.Result.Content.ReadAsStringAsync();
log.LogInformation("Data fetched from Zoho...\n");
var employes = JsonConvert.DeserializeObject<List<Employee>>(data);
return employes;
}
I get the error at line
var data = await response.Result.Content.ReadAsStringAsync();
I have put various log statements to debug the issue and the last log statement that gets printed on azure function log is "Sending Get Request to Zoho...".
I have printed the tokens and other required variables to check whether they have correct values and they are getting the correct value so invalid token is definitely not an issue. Can someone suggest what could be the possible reason for this error ?
are you expecting json response type ? and for best practice perhaps you need to supply in your header of httpclient
string contentTypeValue = "application/json";
client.DefaultRequestHeaders.Add("Content-Type", contentTypeValue);
and also practice
httpResponse.EnsureSuccessStatusCode(); // throws if not 200-299
before read result stream.
Here there is no issue with token or any authentication , just clear out asynchronous programming,
Frist,
Instead, by getting the value of the response.Result property, you force the current thread to wait until the asynchronous operation has completed, and second I will recommend
static readonly HttpClient client = new HttpClient();
try
{
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", _authToken);
Uri myUri = new Uri(_url, UriKind.Absolute);
HttpResponseMessage response = await client.GetAsync(_url);
var data = await response.Result.Content.ReadAsStringAsync();
var employes = JsonConvert.DeserializeObject<List<Employee>>(data);
}
catch (Exception)
{
throw;
}

Connecting to a device on the local network over TCP *sometimes* fails with "No Route To Host" socket error

I'm making an Android app (using Unity and C#) which needs to connect over TCP to a different app running on another device (using the .NET System.Net.Sockets.TcpClient and TcpListener classes). The way this works is the host app broadcasts a UDP packet giving info on its local IP (192.168.x.x) and its TCP listening port. Upon receiving the UDP packet, the Android app attempts to connect to the TCP endpoint given. Most of the time (~80%), this works perfectly and the two devices establish a valid TCP connection. Sometimes though, the Android app receives the UDP packet, tries to connect over TCP but a "No Route To Host" socket error shows up instead; even trying again upon receiving the next UDP packet fails.
I'm suspecting that this is to do with the router creating different subnets. I'm not very familiar with networking code, so I'm not sure how to forward the TCP request over to a different subnet of the local network. What's weird is that the UDP packet is always received no matter what; and most of the time, the TCP request will fail for 10 minutes straight then start working again like nothing happened.
public async Task<bool> ConnectToHost(IPEndPoint endpoint) {
try {
TcpClient client = new TcpClient();
client.NoDelay = true;
IPAddress ipv4 = endpoint.Address;
Debug.Log("IPv4: " + ipv4);
await client.ConnectAsync(ipv4, endpoint.Port); // <--- this call throws the SocketException
Debug.Log("Connected.");
// ...
return true;
}catch(SocketException se) {
Debug.LogError("[TCPClient] Socket Exception (" + se.ErrorCode + "), cannot connect to host: " + se.ToString(), this);
}catch(Exception e) {
Debug.LogError("[TCPClient] Error, cannot connect to host: " + e.ToString(), this);
}
return false;//Could not connect
}
The ConnectAsync() call fails on the client side, giving the following SocketException (error code 10065, WSAEHOSTUNREACH); on server side, no trace of the message is ever seen.
05-29 13:31:54.591: I/Unity(24587): IPv4: 192.168.1.21
05-29 13:31:54.591: I/Unity(24587):
05-29 13:31:54.591: I/Unity(24587): (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 48)
05-29 13:31:58.103: E/Unity(24587): [TCPClient] Socket Exception (10065), cannot connect to host: System.Net.Sockets.SocketException (0x80004005): No route to host
05-29 13:31:58.103: E/Unity(24587): at System.Net.Sockets.SocketAsyncResult.CheckIfThrowDelayedException () [0x00014] in <9eab73f5583e4ab3921ff80e74ccdb29>:0
05-29 13:31:58.103: E/Unity(24587): at System.Net.Sockets.Socket.EndConnect (System.IAsyncResult asyncResult) [0x0002c] in <9eab73f5583e4ab3921ff80e74ccdb29>:0
05-29 13:31:58.103: E/Unity(24587): at System.Net.Sockets.TcpClient.EndConnect (System.IAsyncResult asyncResult) [0x0000c] in <9eab73f5583e4ab3921ff80e74ccdb29>:0
05-29 13:31:58.103: E/Unity(24587): at System.Threading.Tasks.TaskFactory`1[TResult].FromAsyncCoreLogic (System.IAsyncResult iar, System.Func`2[T,TResult] endFunction, System.Action`1[T] endAction, System.Threading.Tasks.Task`1[TResult] promise, System.Boolean requiresSynchronization) [0x00019] in <a6266edc72ee4a578659208aefcdd5e1>:0

Two Asp.Net Applications sending email through SMTP from same server

I have an Asp.Net application running from AWS, and it has some process that require it to send e-mails automatically (the usual welcome, confirm email, etc...).
I was able to configure it and publish it. It works fine. But as the website enters "Production", I need to run a second application for testing purposes. I'm able to create it, and differentiate which one is being requested by the bindings in IIS.
The issue when both are up and running is that when I try to send an e-mail from the "Production" one, it works fine. But from the "Test" one, I get the following Exception:
[0:] {"$id":"1","Message":"Bad Request:System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 177.185.201.253:587\r
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)\r
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)\r
--- End of inner exception stack trace ---\r
at System.Net.Mail.SmtpConnection.ConnectAndHandshakeAsyncResult.End(IAsyncResult result)\r
at System.Net.Mail.SmtpTransport.EndGetConnection(IAsyncResult result)\r
at System.Net.Mail.SmtpClient.ConnectCallback(IAsyncResult result)\r
--- End of inner exception stack trace ---\r
at Shappa.BackEnd.Helpers.EmailSender.<NewPhotoRequired>d__2.MoveNext() in C:\\Andre\\Shappa\\Shappa.BackEnd-Dev\\Shappa.BackEnd\\Helpers\\EmailSender.cs:line 112\r
--- End of stack trace from previous location where exception was thrown ---\r
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r
at Shappa.BackEnd.Controllers.AdminController.<PostPhotoReproved>d__2.MoveNext() in C:\\Andre\\Shappa\\Shappa.BackEnd-Dev\\Shappa.BackEnd\\Controllers\\AdminController.cs:line 78"}
My Code to send email is pretty simple:
public async Task<bool> SendEmail(MailMessage message)
{
try
{
using (var smtp = new SmtpClient())
{
var credential = Config.SMTPCredential;
smtp.Credentials = credential;
smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
//smtp.Host = "smtp.gmail.com";
//smtp.EnableSsl = true;
#if DEBUG
smtp.Host = "smtp.kinghost.net";
#else
smtp.Host = "smtpi.kinghost.net";
#endif
smtp.EnableSsl = true;
smtp.Port = 587;
await smtp.SendMailAsync(message).ConfigureAwait(false);
}
}
catch (Exception ex)
{
throw ex;
}
return true;
}
Any ideas?
I found it. Thanks dlatikay for your comment. It helped me find my stupid mistake.
177.185.201.253:587 this is an IP in Brazil, which meant I was deploying the application in DEBUG mode. Checking the options for publish, I was able to change it to Release. Now it works perfectly from both applications.

HttpClient File Download Error - Unable to read data from the transport connection

I've written an application that in part can download files from a specific web service. The code utilizes an HttpClient to make the calls. The problem is that occasionally I will get a failed request with the following exception message:
Unable to read data from the transport connection: The connection was closed.
I did run across these blog posts, in which the author had to revert the protocol version to 1.0, disable keep alive, and limit the number of service point connections:
http://briancaos.wordpress.com/2012/07/06/unable-to-read-data-from-the-transport-connection-the-connection-was-closed/
http://briancaos.wordpress.com/2012/06/15/an-existing-connection-was-forcibly-closed-by-the-remote-host/
I followed those instructions, as best I knew how and still got the error. I also made sure to keep a single instance of the HttpClient around (following the Singleton principle).
What is interesting is that when running Fiddler I've yet to get the error, which makes me think that there is something that can be done on the client side since Fiddler appears to be doing something to keep the connection alive (though the issue is so sporadic this may be a red herring).
A couple more notes:
The error invariably occurs in the middle of a download (never when initiating the request).
The file continues to download up to the point of failure (there are no extended pauses or delays first).
--UPDATE--
The error occurs on the following line:
responseTask.Wait(cancellationTokenSource.Token);
The following is the full exception:
System.AggregateException occurred HResult=-2146233088 Message=One
or more errors occurred. Source=mscorlib StackTrace:
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at Form1.StartDownload() in c:\Projects\Visual Studio 2012\Demo\Demo\Form1.cs:line 88 InnerException:
System.Net.Http.HttpRequestException
HResult=-2146233088
Message=Error while copying content to a stream.
InnerException: System.IO.IOException
HResult=-2146232800
Message=Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
Source=System
StackTrace:
at System.Net.ConnectStream.EndRead(IAsyncResult asyncResult)
at System.Net.Http.HttpClientHandler.WebExceptionWrapperStream.EndRead(IAsyncResult
asyncResult)
at System.Net.Http.Handlers.ProgressStream.EndRead(IAsyncResult
asyncResult)
at System.Net.Http.StreamToStreamCopy.BufferReadCallback(IAsyncResult ar)
InnerException: System.Net.Sockets.SocketException
HResult=-2147467259
Message=An existing connection was forcibly closed by the remote host
Source=System
ErrorCode=10054
NativeErrorCode=10054
StackTrace:
at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
InnerException:
--UPDATE #2--
I thought I would try changing the completion option from 'content read' to 'headers read'. This also failed with the same exception, albeit in a different location (where the TODO comment is, reading the content stream).
--UPDATE #3--
I can confirm that the web service (which is hosted in IIS) is aborting the connections (the IIS logs show a win32 status code of 1236 - ERROR_CONNECTION_ABORTED). To try and narrow things down, the MinFileBytesPerSec metabase property was set to zero (on the off chance the client stopped pulling down data momentarily) and the connection is still being aborted. I've double checked all the timeouts and buffer sizes I can think of to no avail. Clawing at thin air at the moment. Any ideas would be appreciated.
Client Setup:
private void SetupClient()
{
// In case we're taxing the web server, limit the number
// connections we're allowed to make to one.
ServicePointManager.DefaultConnectionLimit = 1;
// Set up the progress handler so that we can keep track of the download progress.
_progressHandler = new ProgressMessageHandler();
_progressHandler.HttpReceiveProgress += ProgressHandler_HttpReceiveProgress;
// Create our HttpClient.
_client = HttpClientFactory.Create(_progressHandler);
_client.BaseAddress = new Uri("http://localhost");
_client.Timeout = TimeSpan.FromMinutes(30);
_client.DefaultRequestHeaders.TransferEncodingChunked = true;
}
Download Logic:
private void StartDownload()
{
// Create the request.
using (HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, "http://localhost/Download"))
{
// Revert the protocol version and turn off keep alive in accordance with:
// http://briancaos.wordpress.com/2012/07/06/unable-to-read-data-from-the-transport-connection-the-connection-was-closed/
// http://briancaos.wordpress.com/2012/06/15/an-existing-connection-was-forcibly-closed-by-the-remote-host/
request.Version = new Version("1.0");
request.Headers.Add("Keep-Alive", "false");
// Set the cancellation token's timeout to 30 minutes.
int timeoutInMilliseconds = 30 * 60 * 1000;
using (CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(timeoutInMilliseconds))
{
// Making sure that the message isn't "complete" until everything is read in so we can cancel it at anytime.
Task<HttpResponseMessage> responseTask = _client.SendAsync(request, HttpCompletionOption.ResponseContentRead);
responseTask.Wait(cancellationTokenSource.Token);
using (HttpResponseMessage response = responseTask.Result)
{
if (!response.IsSuccessStatusCode)
{
throw new Exception("Request failed!");
}
Task<Stream> streamTask = response.Content.ReadAsStreamAsync();
using (Stream contentStream = streamTask.Result)
{
// TODO: Save to disk.
}
}
}
}
}

Windows phone 8 CommunicationException The remote server returned an error: NotFound

I want to ask a question that make me crazy all this time #_#
I've made an app for windows phone 8 which retrieve data from wcf service.
Luckily, my office mate make me a service for it. But, when I use that service, I got this error.
System.ServiceModel.CommunicationException was unhandled by user code
HResult=-2146233087
Message=The remote server returned an error: NotFound.
Source=System.ServiceModel
StackTrace:
at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
at System.ServiceModel.ClientBase`1.ChannelBase`1.EndInvoke(String methodName, Object[] args, IAsyncResult result)
at NavFinance.NavFinData.NavcoreNavfinServiceClient.NavcoreNavfinServiceClientChannel.EndGetAll(IAsyncResult result)
at NavFinance.NavFinData.NavcoreNavfinServiceClient.NavFinance.NavFinData.INavcoreNavfinService.EndGetAll(IAsyncResult result)
at NavFinance.NavFinData.NavcoreNavfinServiceClient.OnEndGetAll(IAsyncResult result)
at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result)
InnerException: System.Net.WebException
HResult=-2146233079
Message=The remote server returned an error: NotFound.
Source=System.Windows
StackTrace:
at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)
at System.Net.Browser.ClientHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)
InnerException: System.Net.WebException
HResult=-2146233079
Message=The remote server returned an error: NotFound.
Source=System.Windows
StackTrace:
at System.Net.Browser.ClientHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
at System.Net.Browser.ClientHttpWebRequest.<>c__DisplayClasse.<EndGetResponse>b__d(Object sendState)
at System.Net.Browser.AsyncHelper.<>c__DisplayClass1.<BeginOnUI>b__0(Object sendState)
InnerException:
After Searching here and there, I got this good article.
http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj684580(v=vs.105).aspx
But, I read it and still don't get it. Why?
Because my service is write in C# class, not as a web service. So i can't found the IIS service.
Here is my code to generate my data.
public PurchaseInvoiceMainPage()
{
InitializeComponent();
this.Loaded += new RoutedEventHandler(purchaseInvoice_Loaded);
}
private void purchaseInvoice_Loaded(object sender, RoutedEventArgs e)
{
NavcoreNavfinServiceClient client = new NavcoreNavfinServiceClient();
client.GetAllCompleted += new EventHandler<GetAllCompletedEventArgs>(client_getAllPurchaseInvoice);
client.GetAllAsync("509A7214-D3A9-47E7-9BB4-232E670ED650");
}
private void client_getAllPurchaseInvoice(object sender, GetAllCompletedEventArgs e)
{
if (e.Error == null)
{
purchaseDataList.ItemsSource = e.Result;
}
}
And, here is my service which return the result.
public System.Collections.ObjectModel.ObservableCollection<NavFinance.NavFinData.vwPurchaseInvoice> EndGetAll(System.IAsyncResult result) {
object[] _args = new object[0];
System.Collections.ObjectModel.ObservableCollection<NavFinance.NavFinData.vwPurchaseInvoice> _result = ((System.Collections.ObjectModel.ObservableCollection<NavFinance.NavFinData.vwPurchaseInvoice>)(base.EndInvoke("GetAll", _args, result)));
return _result;
}
I got the Exception right on this line.
System.Collections.ObjectModel.ObservableCollection<NavFinance.NavFinData.vwPurchaseInvoice> _result = ((System.Collections.ObjectModel.ObservableCollection<NavFinance.NavFinData.vwPurchaseInvoice>)(base.EndInvoke("GetAll", _args, result)));
I've used many trick that i found, starting from upsizing the maxbytes, etc.
It still does not work.
Some one please help me. I really confuse TT_TT
Here is the service that i use.
http://dev.navcore.com/NavFinWebService/Navcore.Navfin.Service.NavcoreNavfinService.svc
Any answer from all of you will make me think more, please give an answer.
Regards,
Budi Prasetyo
This error indicates that your application was unable to communicate with the service. are you try the service URL in the phone/emulator Internet Explorer to be sure the url is accessible?
woah, amazing..!!
after 3 days suffering about this error, finally found something. :)
All the credit should be given to Josue Yeray
Thanks a lot man, why I am not realize about that erlier.
Finally i got my data from my service only by connecting the emulator to the internet.
In my case, usually i used wired connection, and that's not working at all at the emulator.
after searching, i change my connection to wireless connection.
and then, its working and done.
Thanks a lot. :)
Do nothing Extra, Just go and turn off the Firwall of Public and Private both, then wait for 2-3 mins and then run the App. It will run perfect.
I did and it worked.

Categories

Resources