My WCF service is developed in .Net 3.0 and developed application which is consuming WCF in 3.5. When I try to consume my WCF then I am getting below error --
"The formatter threw an exception while trying to deserialize the
message: There was an error while trying to deserialize parameter
criteria. The InnerException message was 'Invalid enum value
'Positions' cannot be deserialized into type 'SecurityContents'.
Ensure that the necessary enum values are present and are marked with
EnumMemberAttribute attribute if the type has DataContractAttribute
attribute.'. Please see InnerException for more details."
Please help me out in this.
This error means there is a new SecurityContents enum value of "Positions" that your client doesn't know about. You likely need to update your service reference.
I've also seen this if you Reuse types in referenced assemblies. Try unchecking this.
Related
I am using WCF web services and it was using OLD unity 2.0. So i updated Unity and other reference with latest version 5.0. I am getting exception:
Resolution failed with error: No public constructor is available for type xyz.Services.Contracts.Security.IAuthenticationService.
For more detailed information run Unity in debug mode: new UnityContainer().AddExtension(new Diagnostic())
Exception of type 'Unity.Exceptions.InvalidRegistrationException' was thrown.
Really i tried many things but not success. please any expert have a look.
I came across the same error upgrading from Unity version 3.5 to 5.11. In my case, during resolution the exception was the same ResolutionFailedException with message "No public constructor is available for IMyInterface" and having the same inner exception InvalidRegistrationException.
Well, the error messages and types of exceptions were misleading in my case; there was no registration problem nor did I ask for a public constructor for the interface. It seems that there has been a breaking change in the Resolve method overload which takes an instance name. Null names are no longer equivalent to empty string names. Replace your empty string name to null or use the other overload which doesn't specify an instance name:
var service = container.Resolve<xyz.Services.Contracts.Security.IAuthenticationService>();
OR
var service = container.Resolve<xyz.Services.Contracts.Security.IAuthenticationService>(null);
We are using spring-kafka-2.2.7.RELEASE to produce and consume avro messages and using schema registry for schema validation with 'FORWARD_TRANSITIVE' as the compatibility type. Now, I'm trying to use 'ErrorHandlingDeserializer2 ' from spring-kafka to handle the exception/error when a deserializer fails to deserialize a message. Now I'm trying to write a component test to test this configuration. My component test expected to have below steps.
Spin up a local kafka cluster using docker containers
Send an avro message (using KafkaTemplate) with invalid schema to re-create/simulate the deserialization exception onto a test topic
Now what's happening is, since we have schema registry in place, if i send a message with new schema (invalid schema) it's validating the schema as per the compatibility type setting we have and not letting me producer the message onto kafka by throwing an exception at the producer level itself.
Now my question is, In this scenario, how can I create/simulate the creation of deserialization exception to test my configuration. Please suggest.
Note:- I don't want to disable/stop schema registry because that wouldn't simulate our prod setup.
Setup:
Asp.NET Web Api 2 (Running in Azure Cloud service, 3 instances), Entity Framework 6.1 and Sql Azure
Problem
My application started reporting a ton of weird errors all of a sudden.
When using EF to get entities from the database these types of errors are reported:
"The '{PropertyName}' property on '{TableName}' could not be set to a 'System.String' value. You must set this property to a non-null value of type 'System.Int64'"
And
"The '{PropertyName}' property on '{TableName}' could not be set to a 'System.Int64' value. You must set this property to a non-null value of type 'System.String'."
My interpretation is that the database is returning non-matching objects compared to what I'm trying to map against, but I can't see why that would start happening out of the blue, after running just fine for millions of requests.
While I was writing this I rebooted the api instances and now the errors are gone.
Any help in figuring this out will be highly appreciated.
Turned out the probable cause was a mistake in the setup of the unit of work pattern. Note to self: Do not create a new dbcontext to replace a dbcontext that is being used :)
I use OTAClient.dll from HP for conencting with Quality Center.
My connection is correct:
TDConnection tdCon = new TDConnection();
tdCon.InitConnectionEx("http://....");
tdCon.Login("username", "userpass");
tdCon.Connect("****", "********");
But in this area i get error:
Req newReq = new Req();
I set platform target in x86 but didn't help me
Instead of COM object use the rest library. You could send xml documents with parameters for creating and updating requirements(Req) in QC. You can find documentation in QC.
You will use "post" method by HttpWebRequest for creating and updating, "get" method for getting session parameters.
In the rest library look to creating entity description. For maintaining connections you must save QCSessionId. Look to authentication description.
Good luck!
How to deal with a server that doesn't support 'date'? Sorry for such a vague question. Please let me know what addtional details I should add. Thanks.
Here's the error:
Server Error in '/' Application.
The version of SQL Server in use does not support datatype 'date'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: The version of SQL Server in use does not support datatype 'date'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
For the Column Properties from the server explorer, I've specified the column as a datetime, so I'm not sure why the auto generated ASP.NET gridview is trying to work with a date type as opposed to a datetime type.
Here's the code auto-generated by the ASP.NET 2.0 grid view that is causing the error:
Is it okay to just change DbType="Date" to DbType="Datetime"? (It seems to work.)
Most likely you are looking for either the datetime or smalldatetime type:
Date and time data types for representing date and time of day
You could also create a user-defined type based on DateTime that always has a time component equal to 0 (aka midnight).
SQL Server pre-2008 does not support just DATE like Oracle (and some other RDBMS).
You are probably looking at DateTime or SmallDateTime
Most of us use either one of those - we just leave the time part as 00:00:00.