Affiliate Window API passing columns to Service Causes Application Crash (VB.net)

112 Views Asked by At

This generates a crash, and I have no idea why?

I have very little experience using SOAP/WSDL and I think this may be why I have no idea how to even start to debug this.

Sub Main()
    Dim service As AWIN.ApiService = New AWIN.ApiService
    Dim columns As AWIN.getProductList
    Dim AWresults() As AWIN.Product
    Dim response As New AWIN.getProductListResponse
    Dim total As Integer
    Dim activerefine As AWIN.RefineByGroup
    Dim refine As AWIN.RefineByGroup

    Const token As String = "xxy"

    Dim UA As AWIN.UserAuthentication = New AWIN.UserAuthentication
    With UA
        .sApiKey = token
    End With
    service.UserAuthenticationValue = UA

    columns = New AWIN.getProductList
    Dim stringsofthings As String() = {"sId", "iCategoryId", "iMerchantId", "sMerchantProductId", "iAdult", "bHotpick", _
                               "iUpc", "iEan", "sMpn", "iIsbn", "sName", "sDescription", "sSpecification", _
                               "sPromotion", "sBrand", "sModel", "sAwDeepLink", "sAwThumbUrl", "sAwImageUrl", _
                               "sMerchantThumbUrl", "sMerchantImageUrl", "sDeliveryTime", "fPrice", "sCurrency", _
                               "fStorePrice", "fRrpPrice", "fDeliveryCost", "bWebOffer", "bPreOrder", "sWarranty"}

    columns.sColumnToReturn = stringsofthings
    response = service.getProductList(columns)

    For c = 0 To UBound(response.oProduct)
        ReDim Preserve AWresults(c)
        AWresults(c) = New AWIN.Product
        AWresults(c) = response.oProduct(c)
        Console.WriteLine(AWresults.ToString)
    Next
    Console.ReadLine()

End Sub
0

There are 0 best solutions below