I'm trying to send a class on wcf, I am having problems to serialize this class System.Windows.Media.Media3D.Vector3d. I get this exception
There was an error while trying to serialize parameter WEntityService:iState.
The InnerException message was 'Type 'System.Windows.Media.Media3D.Vector3D' with data contract name
'Vector3D:http://schemas.datacontract.org/2004/07/System.Windows.Media.Media3D' is not expected. Consider
using a DataContractResolver or add any types not known statically to the list of known types - for example,
by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.'.
Please see InnerException for more details.
[DataContract]
public ref class WData
{
public:
WData();
[DataMember]
Vector3D^ mLinearVelocity;
[DataMember]
System::String^ mName;
};
WData::WData()
: mLinearVelocity(gcnew Vector3D(0.0, 0.0, 0.0))
, mName(gcnew System::String(' ', 1))
{
}
On the msdn web site http://msdn.microsoft.com/en-us/library/ms606682.aspx, you can see that Vector3D has Serializable attiribute. For the wcf serialisable type if I refer to this web page: http://msdn.microsoft.com/en-us/library/ms731923.aspx Vector3D should be serializable for the wcf. Can someone explain me why It's not serialized. Thks.