Rank: Member
Joined: 3/10/2008(UTC) Posts: 5
|
I'm having trouble getting products to return when doing a FindByCriteria with Webservices3.asmx.. Here's an example of all I'm trying to do: Code: dim s as New bvWeb3.ProductSearchCriteria s.Keyword = "whatever"
dim bvProducts() as bvWeb3.Product = bvServices.Catalog_InternalProduct_FindByCriteria(Token, s) dim bvProduct as bvWeb3.Product
for each bvProduct in bvProducts listbox1.items.add(bvProduct.ProductName) next
bvWeb3 is the web reference. bvServices are bvWeb3.WebServices3. Token is defined and successfully authenticated. This returns zero items in bvProducts(). It seems like no matter what I put into the ProductSearchCriteria, it never returns any items. When I run this same thing, but without the ProductSearchCriteria and instead doing this: bvServices.Catalog_InteralProduct_FindAll(Token) It returns all of the products fine. Can anyone point me in the right direction of how to figure this out? Or explain what I'm doing wrong when using the ProductSearchCriteria? Thanks in advance. -james
|
|
|
|
Rank: Member
Joined: 11/5/2003(UTC) Posts: 2,136
Was thanked: 1 time(s) in 1 post(s)
|
I have not looked at the ProductSearchCriteria class, but my guess is there are some other properties that you have to set. For example, if there are search ranges make sure they include all your products. |
|
|
|
|
Rank: Member
Joined: 3/10/2008(UTC) Posts: 5
|
When ProductSearchCriteria is created (before I touch any properties) it looks like this: Code: {bvProducts.bvWeb3.ProductSearchCriteria} CategoryId: Nothing categoryIdField: Nothing ChoicesAndChoiceOptions: Nothing choicesAndChoiceOptionsField: Nothing CustomProperties: Nothing customPropertiesField: Nothing InventoryStatus: NotAvailable {0} inventoryStatusField: NotAvailable {0} ItemsAddedInLastXDays: 0 itemsAddedInLastXDaysField: 0 Keyword: Nothing keywordField: Nothing KeywordIsExact: False keywordIsExactField: False LastXNumberOfItemsAddedToStore: 0 lastXNumberOfItemsAddedToStoreField: 0 ManufacturerId: Nothing manufacturerIdField: Nothing MaxPrice: 0D maxPriceField: 0D MinPrice: 0D minPriceField: 0D NotCategoryId: Nothing notCategoryIdField: Nothing ParentId: Nothing parentIdField: Nothing ProductTypeId: Nothing productTypeIdField: Nothing SortBy: ProductName {0} sortByField: ProductName {0} SortOrder: NotSet {0} sortOrderField: NotSet {0} SpecialProductTypeOne: NotSet {0} specialProductTypeOneField: NotSet {0} SpecialProductTypeTwo: NotSet {0} specialProductTypeTwoField: NotSet {0} Status: Active {0} statusField: Active {0} VendorId: Nothing vendorIdField: Nothing
When I use the similar OrderSearchCriteria I can fill out any one thing and it will work fine, returning exactly what I ask for. But this ProductSearchCriteria just returns nothing every single time no matter how many properties I set. And I set the properties to things like MinPrice = 0 and MaxPrice = 999999.. Like designed to return everything.
|
|
|
|
Rank: Member
Joined: 11/5/2003(UTC) Posts: 2,136
Was thanked: 1 time(s) in 1 post(s)
|
Check the token after the call returns to make sure the specific call is not rejected (if it is then token.TokenRejected will be true after the call returns).
Looking at the code, you can ignore min and max price by setting them to -1. It looks like all the other fields will be ignored by default (except Status).
If it still does not work, you will have to start digging in. |
|
|
|
|
Rank: Member
Joined: 3/10/2008(UTC) Posts: 5
|
Here is the Token after attempting a ProductSearch Code: {bvProducts.bvWeb3.AuthenticationToken} Bvin: "91bf0c0a-3bd3-417e-a59a-6c9e58d47469" bvinField: "91bf0c0a-3bd3-417e-a59a-6c9e58d47469" ExpirationDate: #5/15/2009 6:15:24 PM# expirationDateField: #5/15/2009 6:15:24 PM# ExpirationDateUTC: #5/15/2009 10:15:24 PM# expirationDateUTCField: #5/15/2009 10:15:24 PM# IsExpired: False isExpiredField: False LastUpdated: #12:00:00 AM# lastUpdatedField: #12:00:00 AM# TokenRejected: False tokenRejectedField: False UserBvin: "dd429e5f-49c5-4221-bb0c-c69668b36ee2" userBvinField: "dd429e5f-49c5-4221-bb0c-c69668b36ee2"
So it looks like the Token is still alright, no? Is there anything else you know of that I can look at?
|
|
|
|
Rank: Member
Joined: 11/5/2003(UTC) Posts: 2,136
Was thanked: 1 time(s) in 1 post(s)
|
I were you I would have already jumped to the other side of the conversation. For example, create a local BVC5 site, load it in a debugger, set a break point at the inbound web service method, and then step through. Or if you can't do that, then attach SQL Profiler to the database and then inspect the stored procedure call and results. Or poke around the BVC5 web pages to find some other code that is using the product FindByCriteria method and see how it calls the method. |
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.