Page 1 of 1

Can't import orders to Stone Edge - Live with Gold

Posted: Wed Nov 19, 2014 3:25 pm
by meer2005
Went live but now can't import orders to Stone Edge Order Manager. Stone edge support has sent us the following error and said AbleCommerce will have to fix before it will work. Here is the error:

Code: Select all

SETIError: System.ArgumentException: The value "System.Object[]" is not of type "CommerceBuilder.Orders.OrderItem" and cannot be used in this generic collection.
Parameter name: value
   at System.ThrowHelper.ThrowWrongValueTypeArgumentException(Object value, Type targetType)
   at System.Collections.Generic.List`1.System.Collections.IList.Add(Object item)
   at NHibernate.Util.ArrayHelper.AddAll(IList to, IList from)
   at NHibernate.Impl.SessionImpl.ListCustomQuery(ICustomQuery customQuery, QueryParameters queryParameters, IList results)
   at NHibernate.Impl.SessionImpl.List(NativeSQLQuerySpecification spec, QueryParameters queryParameters, IList results)
   at NHibernate.Impl.SessionImpl.List[T](NativeSQLQuerySpecification spec, QueryParameters queryParameters)
   at NHibernate.Impl.SqlQueryImpl.List[T]()
   at SETIService.Do_DownloadOrders(HttpResponse HttpResponse, XmlDocument& xRespDoc, String OrderDate, String LastOrder, String StartNum, String BatchSize, Boolean CountOnly, String PassPhrase, Store& objStore, Boolean bDSSMode) in D:\www\site-gold\Client\SETIService.ashx:line 1009
   at SETIService.Do_Download(HttpResponse HttpResponse, Store objStore, String Which, String Update, String Count, String OrderDate, String LastOrder, String BatchSize, String StartNum, String PassPhrase, Boolean bDSSMode) in D:\www\site-gold\Client\SETIService.ashx:line 352
   at SETIService.Dispatcher(HttpResponse HttpResponse, Store objStore, String OMFunction, String Update, String Count, String OrderDate, String LastOrder, String OrderNumber, String OrderStatus, String BatchSize, String StartNum, String PassPhrase, Boolean bDSSMode) in D:\www\site-gold\Client\SETIService.ashx:line 289
   at SETIService.ProcessSETIRequest(HttpContext Context) in D:\www\site-gold\Client\SETIService.ashx:line 186

Re: Can't import orders to Stone Edge - Live with Gold

Posted: Thu Nov 20, 2014 1:04 am
by mazhar
It seems like you have some custom module with some Nhibernate query. From exception it seems nhibernate query is expecting results of orderitem type but instead something else is returned. Please have a look at maybe line#186 in SETIService.ashx file where you have query returning OrderItems.

Re: Can't import orders to Stone Edge - Live with Gold

Posted: Thu Nov 20, 2014 4:00 am
by jmestep
It could be because of where the file is located. In Gold, it has to be in the Mobile folder, but I don't remember why. We have a few sites running SE in Gold fine with the SETIService.ashx in the Mobile folder.

Re: Can't import orders to Stone Edge - Live with Gold

Posted: Thu Nov 20, 2014 5:29 am
by Naveed
Can you please ask more details about the error and the fix from the Stone Edge?

Or provide the link to download the Stone Edge for AC Gold.

Re: Can't import orders to Stone Edge - Live with Gold

Posted: Thu Nov 20, 2014 7:24 am
by meer2005
I know it was originally in the mobile folder and then it was moved because there were issues with it not finding the file because the mobile store is not enabled, if i remember right. Initially it was in the mobile directory and we did get this same error. We did get get orders to download 3 separate times, once with it in the mobile directory and and then in different directories. It would work for a couple downloads and then go back to the error.

There is no link to the Stone Edge Gold file without logging in, so I've just attached it.

Re: Can't import orders to Stone Edge - Live with Gold

Posted: Thu Nov 20, 2014 11:56 am
by meer2005
I think I've drilled down what's causing the errors. It seems to be on kitted items, which is why it's worked and then stopped. It will not import kitted items and once it hits a kitted item, it stops and wont download any orders past that one. I've tried changing the kit invoice display style from bundle to itemized and it still wont get past kitted or import kitted items whether they are set to itemized or bundle.

Re: Can't import orders to Stone Edge - Live with Gold

Posted: Thu Nov 20, 2014 12:19 pm
by mazhar
meer2005 wrote:I know it was originally in the mobile folder and then it was moved because there were issues with it not finding the file because the mobile store is not enabled, if i remember right. Initially it was in the mobile directory and we did get this same error. We did get get orders to download 3 separate times, once with it in the mobile directory and and then in different directories. It would work for a couple downloads and then go back to the error.

There is no link to the Stone Edge Gold file without logging in, so I've just attached it.
Locate following code in SETIService.ashx file

Code: Select all

colChildren = CommerceBuilder.DomainModel.NHibernateHelper.CreateSQLQuery(sSQL).List(Of CommerceBuilder.Orders.OrderItem)()
and update it like this

Code: Select all

colChildren = CommerceBuilder.DomainModel.NHibernateHelper.CreateSQLQuery(sSQL).AddEntity(GetType(CommerceBuilder.Orders.OrderItem)).List(Of CommerceBuilder.Orders.OrderItem)()
Save the file and now give it a try.

Re: Can't import orders to Stone Edge - Live with Gold

Posted: Thu Nov 20, 2014 12:27 pm
by mazhar
meer2005 wrote:I think I've drilled down what's causing the errors. It seems to be on kitted items, which is why it's worked and then stopped. It will not import kitted items and once it hits a kitted item, it stops and wont download any orders past that one. I've tried changing the kit invoice display style from bundle to itemized and it still wont get past kitted or import kitted items whether they are set to itemized or bundle.
It seems to me that no else used the script with similar configuration to what you have hence this code block was never executed. The query seems to have problem due to some missing configurations required by Nhibernate query API. Please give a try to fix I proposed above.

Re: Can't import orders to Stone Edge - Live with Gold

Posted: Thu Nov 20, 2014 12:33 pm
by meer2005
I think that did it. Kits are now able import. I'll pass this along to Stone Edge so they can update their script. Thank you!

Re: Can't import orders to Stone Edge - Live with Gold

Posted: Thu Nov 20, 2014 12:40 pm
by mazhar
meer2005 wrote:I think that did it. Kits are now able import. I'll pass this along to Stone Edge so they can update their script. Thank you!
Great! Yeah please do inform Stone Edge to update script with this change. Thanks!