PDA

View Full Version : getting products in asp.net c#


J0N3S3Y
11-09-08, 13:39
Hi,

Well, i've been battling for a while now with this api, its not the most straightforward and I have now managed to get the categories back and I can search however, how do I get the products for a category back?

eg:

getProductList affGetProds = new getProductList();
getProductListResponse affProdResponse = new getProductListResponse();

affGetProds.oActiveRefineByGroup ?????????
affProdResponse = affWebService.getProductList(affGetProds);

foreach (Product Prod in affProdResponse.oProduct)
{
Response.Write("<strong>Description:</strong> " + Prod.sDescription.ToString() + "<strong>Price: £</strong>" + Prod.fPrice);
}

I think I'm along the right lines but oActiveRefineByGroup accepts iID except I cant see how to get it.

Any ideas? even better, if someone has some useful documentation or examples for ASP.net C# would you be willing to share? as AffiliateWindow have told me they have none and cannot assist with ASP.net queries.

indy2005
20-01-09, 13:24
Hi,

I have asked the same question. Forget the .net part, how do you do it from a SOAP perspective. I hope someone answers this, as lack of forum repsonses can turn people off an API.

Regards

SM

Ollie
20-01-09, 15:28
Hi there,

You are correct using the oActiveRefineByGroup parameter.

iId can take one of four values:
A refineby can belong to one of four categories:
1) Price
2) Brand
3) Merchant
4) Category

Each refineby must also have a definition. The definition is the value that you wish to apply to the selected category.

I cannot help you with .NET but understanding the above may give you a push in the correct direction. You may also wish to check out the 'client software parameter examples' document available from your affiliate area for an example (in PHP im afraid) on how this can be implemented.

Hope this helps.

Anyone with .NET experience care to make any suggestions?

J0N3S3Y
01-02-09, 00:17
I really hope that someone somewhere does some decent documentation for using this API with other languages like C# rather than just PHP and that the next version is a bit easier to use.

For example: http://code.google.com/apis/adwords/docs/samples.html

suedeapple
22-02-10, 13:33
Not sure in C#, but this is what I do in VB. You have to create a RefineByDefinition and RefineByDefinition, and past that through to RefineByDefinition as an array

Dim rByD As New com.productserve.com.core.v3.RefineByDefinition()
rByD.sId = "235"
rByD.sName = "Category"


Dim rByG As New com.productserve.com.core.v3.RefineByGroup()
rByG.sName = "Category"
rByG.iId = 4
rByG.oRefineByDefinition = New RefineByDefinition() {yo}


' Lets define our list type
Dim getList As New com.productserve.com.core.v3.getProductList
getList.sColumnToReturn = Split("sName,fPrice", ",")
getList.sQuery = "Cheese"
getList.iLimit = 25
getList.iLimitSpecified = True
getList.oActiveRefineByGroup = New RefineByGroup() {rByG}

suedeapple
22-02-10, 15:35
Not sure in C#, but this is what I do in VB. You have to create a RefineByDefinition and RefineByDefinition, and past that through to oActiveRefineByGroup as an array

Dim rByD As New com.productserve.com.core.v3.RefineByDefinition()
rByD.sId = "235"
rByD.sName = "Category"


Dim rByG As New com.productserve.com.core.v3.RefineByGroup()
rByG.sName = "Category"
rByG.iId = 4
rByG.oRefineByDefinition = New RefineByDefinition() {rByD}


' Lets define our list type
Dim getList As New com.productserve.com.core.v3.getProductList
getList.sColumnToReturn = Split("sName,fPrice", ",")
getList.sQuery = "Cheese"
getList.iLimit = 25
getList.iLimitSpecified = True
getList.oActiveRefineByGroup = New RefineByGroup() {rByG}