Object does not match target type (Commerce Server 2007)

Março 5, 2008 at 5:19 pm Deixe um comentário

Contexto
A classe LineItem foi customizada para a inclusão de novas propredeades, conforme recomendações em http://msdn2.microsoft.com/en-us/library/bb219308.aspx.

Problema
Ao tentar recuperar um basket utilizando um objeto BasketManager, a seguinte mensagem de erro é apresentada:

Object does not match target type.

Solução
As configurações do elemento serializationBindings estão incorretas. O tipo antigo (oldType) deve estar configurado com o LineItem básico do Commerce, e o novo tipo com a classe especializada:

<SerializationBindings>

<SerializationBinding OldType=”Microsoft.CommerceServer.Runtime.Orders.LineItem , Microsoft.CommerceServer.Runtime ,Version=6.0.1.0,Culture=neutral, PublicKeyToken=31bf3856ad364e35″ NewType=”Bmf.CommerceServer.Runtime.Orders.LineItemIE, Bmf.CommerceServer.Runtime.Orders”/>

</SerializationBindings>

Referências

http://msdn2.microsoft.com/en-us/library/bb219308.aspx
http://msdn2.microsoft.com/en-us/library/aa544781.aspx

Erros capturados através do WinDBG:

!pe

Exception object: 05eaab7c

Exception type: System.Reflection.TargetException

Message: Object does not match target type.

InnerException: <none>

StackTrace (generated):

<none>

StackTraceString: <none>

HResult: 80131603

!dso

007cee54 05eaab7c System.Reflection.TargetException

007cee70 015c1840 System.Reflection.RuntimeMethodInfo

007cee7c 790d57b4 System.String

007cee84 05e72f68 Microsoft.CommerceServer.Runtime.Orders.LineItem

007ceebc 05e72f68 Microsoft.CommerceServer.Runtime.Orders.LineItem

007ceedc 057957d4 Microsoft.CommerceServer.Internal.Orders.Storage.ReflectionMember

007ceee0 057957b4 Microsoft.CommerceServer.Internal.Orders.Storage.PropertyMemberAccess

007ceee4 015c18c0 System.String CPF

007cef04 01593ea8 System.RuntimeType

007cef18 0578d490 Microsoft.CommerceServer.Internal.Orders.Storage.ClassInfo

007cef1c 05e72f68 Microsoft.CommerceServer.Runtime.Orders.LineItem

007cef20 016d4a54 System.String LineItemIE

!clrstack

007cee70 7962d9f6 System.Reflection.RuntimeMethodInfo.CheckConsistency(System.Object)

007cee7c 794001ab System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo, Boolean)

007ceeb8 7940012a System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)

007ceed8 79402038 System.Reflection.RuntimePropertyInfo.GetValue(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)

007ceefc 79401ff3 System.Reflection.RuntimePropertyInfo.GetValue(System.Object, System.Object[])

007cef04 172c3fa0 Microsoft.CommerceServer.Internal.Orders.Storage.PropertyMemberAccess.Get(System.Object)

007cef0c 172c6485 Microsoft.CommerceServer.Internal.Orders.Storage.PropertyMemberAccess.RawGet(System.Object)

007cef10 172c613d Microsoft.CommerceServer.Runtime.Orders.OrderSerializer.PopulateDataSet(System.Object, Microsoft.CommerceServer.Internal.Orders.Storage.ClassInfo, System.String, System.Data.DataSet, Microsoft.CommerceServer.Runtime.Orders.CollectionMetaDataMap)

007cef88 172c6a5a Microsoft.CommerceServer.Runtime.Orders.OrderSerializer.ProcessComplexCollections(Microsoft.CommerceServer.Internal.Orders.Storage.ClassInfo, System.Data.DataSet, Microsoft.CommerceServer.Runtime.Orders.CollectionMetaDataMap, System.String, Microsoft.CommerceServer.Runtime.Orders.CollectionMetaData, System.Collections.IEnumerator)

007cefb8 172c63b9 Microsoft.CommerceServer.Runtime.Orders.OrderSerializer.PopulateDataSet(System.Object, Microsoft.CommerceServer.Internal.Orders.Storage.ClassInfo, System.String, System.Data.DataSet, Microsoft.CommerceServer.Runtime.Orders.CollectionMetaDataMap)

007cf030 172c6a5a Microsoft.CommerceServer.Runtime.Orders.OrderSerializer.ProcessComplexCollections(Microsoft.CommerceServer.Internal.Orders.Storage.ClassInfo, System.Data.DataSet, Microsoft.CommerceServer.Runtime.Orders.CollectionMetaDataMap, System.String, Microsoft.CommerceServer.Runtime.Orders.CollectionMetaData, System.Collections.IEnumerator)

007cf060 172c63b9 Microsoft.CommerceServer.Runtime.Orders.OrderSerializer.PopulateDataSet(System.Object, Microsoft.CommerceServer.Internal.Orders.Storage.ClassInfo, System.String, System.Data.DataSet, Microsoft.CommerceServer.Runtime.Orders.CollectionMetaDataMap)

007cf0d8 172c5f93 Microsoft.CommerceServer.Runtime.Orders.OrderSerializer.ConvertToDataSet(Microsoft.CommerceServer.Runtime.Orders.OrderGroup)

007cf0fc 172c0aed Microsoft.CommerceServer.Orders.DataManagement.ServerOrderSystem.GetBasketAsDataSet(System.Guid)

007cf150 172c0812 Microsoft.CommerceServer.Orders.WebService.OrdersWebService.GetBasketAsDataSet(System.Guid)

 

Abraços!

Anúncios

Entry filed under: Commerce Server.

Garantindo a configuração dos servidores para o Commerce Server 2007 Commerce Server 2007, 0/n

Deixe uma Resposta

Preencha os seus detalhes abaixo ou clique num ícone para iniciar sessão:

Logótipo da WordPress.com

Está a comentar usando a sua conta WordPress.com Terminar Sessão / Alterar )

Imagem do Twitter

Está a comentar usando a sua conta Twitter Terminar Sessão / Alterar )

Facebook photo

Está a comentar usando a sua conta Facebook Terminar Sessão / Alterar )

Google+ photo

Está a comentar usando a sua conta Google+ Terminar Sessão / Alterar )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Calendário

Março 2008
S T Q Q S S D
« Fev   Abr »
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Most Recent Posts


%d bloggers like this: