There is an asp.net based backend, where I use wcf services to communicate with client, which is a WPF application. When the data comes back from server, and during deserialization, it throws a communication exception. Here is the exception:
Exception thrown: 'System.ServiceModel.CommunicationException' in mscorlib.dll
Additional information: Error in deserializing body of reply message for operation 'AutoImportGetProtokolls'. The input source is not correctly formatted.
Source: http://pastebin.com/ZtUxYNUm
Here is a photo about the exception: https://www.dropbox.com/s/5araq9oajhrhrty/communicationexception.png?dl=0
I have another application based on silverlight, and when I call the same service, the exception does not come. After I start the WPF application the exception comes every time for first service call, after that it comes "randomly" (I could not find any logic when)
What I have tried so far but did not help:
-I used a DTO (data transfare object) class instead of generated one by entity framework. (sp_AutoImport_GetProtokolls_Result)
-Deleted the "out ErrorCustomModel res" parameter from service.
-Many source in google said that I should take a look for webconfing, and increase the property value of readerquotas. Here is the relevant part of webconfig: pastebin.com/e4ZpQsMK
Thank you guys, every hint are welcome.
Best Regards,
Norbert
Related
I am logging the connection status events with the wcf relay, and I'm seeing something like this in the logs.
1/26 06:47:12 ERROR Service Bus ConnectionStatus: 'Reconnecting' Event. [(null)][42]
LastError: System.ServiceModel.CommunicationException: Exception of type 'System.ServiceModel.CommunicationException' was thrown. ---> Microsoft.ServiceBus.Messaging.Amqp.AmqpException: An AMQP error occurred (condition='amqp:unauthorized-access').
--- End of inner exception stack trace ---
This exception doesn't show up in the list on this microsoft page, and the only other post I can find anywhere related to this error message is here. However, that post does not have any recent comments or a resolution or workaround for the issue. Also, the exception doesn't have any stacktrace, so how am I supposed to troubleshoot this error?
I guess as a follow-up, I would ask whether this is anything to actually worry about if the wcf connection is never faulting.
Apparently, the token that the relay keeps refreshing to stay active requires the time on the server to match the azure service that it is connecting with, and if not, this type of error will show up. We were able to fix it by correcting the server time.
I'm trying to create a QMSClient object using the constructor that accepts [string endpointConfigurationname, string remoteAddress]. When executing the code the following exception is thrown
An unhandled exception of type 'System.InvalidOperationException' occurred in System.ServiceModel.dll
Additional information: Could not find endpoint element with name 'BasicHttpBinding_IQMS' and contract 'QMSAPIService.IQMS' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this name could be found in the client element.
I have successfully connected to the server I entered in the remoteAddress parameter using the default constructor for the QMSClient, but for some reason when I use this constructor it throws the exception. I followed the instructions in the QMSAPI Documentation under the service key injection example. The reason I wish to use this constructor is so I can have a parameterized server address as I will need to change between the target QlikView server on different executions of my program.
As I said I have connected successfully with the default constructor, meaning my service reference and config file have been configured properly. Here is a snippet of my code:
IQMS apiClient = new QMSClient("BasicHttpBinding_IQMS", "http://qlikviewdev:4799/QMS/Service");
ServiceKeyClientMessageInspector.ServiceKey = apiClient.GetTimeLimitedServiceKey();
Any help is greatly appreciated.
EDIT: I have now successfully connected to the original server using the constructor mentioned, my new problem is that when trying to connect to a different server, an exception is thrown on the next line when attempting to generate a service key for the QMSClient object.
ServiceKeyClientMessageInspector.ServiceKey = apiClient.GetTimeLimitedServiceKey();
The exception is as follows
An unhandled exception of type 'System.ServiceModel.ActionNotSupportedException' occurred in mscorlib.dll
Additional information: The message with Action 'http://ws.qliktech.com/QMS/12/IQMS/GetTimeLimitedServiceKey' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).
I am following the QMSAPI Documentation instructions and am not seeing any directions to update the config file or ServiceSupport files when attempting to connect to a different server. I hope to make advances on this soon.
i have a question which is bothering me for a long time.
I am using Windows Phone 8 and c#.
From time to time I get this Excpetion while downloading a file from the web:
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.ni.dll
A first chance exception of type 'System.Net.WebException' occurred in System.Windows.ni.dll
A first chance exception of type 'System.Net.WebException' occurred in System.Windows.ni.dll
ExceptionMessage:The remote server returned an error: NotFound.
But then I run the programm again and it works fine. I don't know why it can't find the remote server sometimes, is the problem really with the server?
It think its something in my code, i use these functions:
WebRequest request = WebRequest.Create("http...);
IAsyncResult res = request.BeginGetResponse(new AsyncCallback(DownloadComplete), null);
I would be grateful for any advice, because this Exception keeps popping up and I couldn't solve it.
It doesn't say it can't find the remote server, but that the server balked at the file requested because it didn't exist on that remote server at that time. It's hard to know your exact scenario, but putting aside network issues, it could be something as simple as the file doesn't exist, at that point in time.
How often is this file being updated, if ever? Think of the possibility that, at the time you request the file, it has been deleted and will momentarily be rewritten.
The web isn't inherently reliable and is only made to look reliable; there are numerous techniques in this, but what I'm saying is that, in your case, it might be worse some 'recovery' logic to try again upon failure after a period.
Just a possibility.
I get this when I forget the phone is running in an emulator and change the web reference to localhost. Localhost will then be interpreted on the phone itself and obviously the web service isn't running on the phone. If you are doing local debugging, make sure to use your machine's IP address and not localhost or 127.0.0.1.
I am implementing the SMPP client using EasySMPP for .NET
The application is compiling fine but there was no successful outcome and I am getting this weird error
SMPP BIND ERROR: 0x0000000D
What can be done for this, please help.
The error code of 0x0000000D is unfortunately a rather generic "Bind Failed".
To find out what the error codes mean check section 5.1.3, command_status, of the SMPP specification you linked to.
Common causes for getting a "Bind Failed" response are:
Your supplier only allows certain IP addresses to connect
Trying to connect to wrong hostname/port combination
Wrong username/password
To troubleshoot, you could try running Wireshark on your client and take a look at the SMPP PDUs being passed backwards and forwards, if you post the capture on here I'm happy to take a look. Or you could give your supplier a call, they may be able to see something helpful in their server logs.
I want to catch all unhandled exceptions thrown in a remote object on the server and log them there before I translate them into some custom exception so that specific exceptions do not cross the client/server boundary.
I think I have to use a custom channel sync, but can anyone confirm this and/or have any other advice to give?
I would use the Microsoft Enterprise Library Exception Handling app block -- it lets you handle errors and convert specific types of exception to a different type of exception before rethrowing to the client.
After finding Eliyahu Baker's helpful blog post and reading chapter 12 of Rammer's Advanced .NET Remoting I wrote a custom channel sink that does what I want. This intercepts any exception and logs it locally before sending it on to the client.
Ideally, I'd like to log the exception and raise a more generic one for the client, but I haven't cracked that nut yet.