Fehler Amazon MWS Request

  • VB.NET
  • .NET (FX) 4.0

Es gibt 5 Antworten in diesem Thema. Der letzte Beitrag () ist von xtts02.

    Fehler Amazon MWS Request

    Hallo,

    folgender Code erzeugt eine Exception in der angegebenen Zeile (natürlich werden alle IDs korrekt übergeben):

    Quellcode

    1. Imports MarketplaceWebServiceProducts
    2. Imports MarketplaceWebServiceProducts.Model
    3. Private Sub subAMAZON()
    4. Try
    5. Dim mwsCFGPROD As New MarketplaceWebServiceProductsConfig
    6. mwsCFGPROD.ServiceURL = "https://mws.amazonservices.com/Products/2011-10-01/"
    7. mwsCFGPROD.SignatureMethod = "HmacSHA256"
    8. mwsCFGPROD.SignatureVersion = "2"
    9. Dim mwsSERVICE As New MarketplaceWebServiceProductsClient("MYACCESSKEY", "MYSECUREKEY")
    10. Dim mwsREQPROD As New MarketplaceWebServiceProducts.Model.ListMatchingProductsRequest
    11. mwsREQPROD.MWSAuthToken = "MYAUTHTOKEN"
    12. mwsREQPROD.SellerId = "MYSELLERID"
    13. mwsREQPROD.MarketplaceId = "MARKETPLACEID"
    14. mwsREQPROD.Query = "harry potter dvd"
    15. Dim mwsRESPONSE As ListMatchingProductsResponse
    16. ' Hier wird die Exception ausgelöst:
    17. mwsRESPONSE = mwsSERVICE.ListMatchingProducts(mwsREQPROD)
    18. If mwsRESPONSE.IsSetListMatchingProductsResult Then
    19. If mwsRESPONSE.ListMatchingProductsResult.IsSetProducts Then
    20. For Each Product As Product In mwsRESPONSE.ListMatchingProductsResult.Products.Product
    21. strMELD = "Product: " & Product.AttributeSets.ToString
    22. MessageBox.Show(strMELD, "Product Attributes", MessageBoxButtons.OK)
    23. Next
    24. End If
    25. End If
    26. Catch ex As MarketplaceWebServiceProductsException
    27. strMELD = "Fehler beim Amazon Webshopexchange: " & ex.ErrorCode & Chr(10) & "Zeile: " & Strings.Right(ex.StackTrace, 50)
    28. MessageBox.Show(strMELD, "Bitte beachten", MessageBoxButtons.OK)
    29. End Try
    30. End Sub


    Leider enthält ex.ErrorCode keinen Wert , ich weiß also nicht, was da falsch ist. Wär prima, wenn mir jemand helfen könnte.

    Danke im voraus!

    Gruß Schorsch
    Gute Idee!

    Der Fehler lautet:

    Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.

    Ich habe daraufhin die Zeile geändert:

    Quellcode

    1. Dim mwsRESPONSE As New ListMatchingProductsResponse


    Der Fehler bbleibt derselbe. Das sind die Details (die mir nichts sagen):

    MarketplaceWebServiceProducts.MarketplaceWebServiceProductsException wurde nicht behandelt.
    HResult=-2146233087
    Source=MWSClientCsRuntime-1.0
    StackTrace:
    bei MWSClientCsRuntime.MwsConnection.Call[T](IMwsRequestType`1 type, IMwsObject requestData)
    bei MarketplaceWebServiceProducts.MarketplaceWebServiceProductsClient.ListMatchingProducts(ListMatchingProductsRequest request)
    bei QPSIEX70.frmHauptformular.subCHECK_AZ() in C:\ENTWICKLUNG\QUISY70\MODULE\IS_MARKTPLATZ\QPSIEX70\QPSIEX70\frmHauptformular.vb:Zeile 675.
    bei QPSIEX70.frmHauptformular.Timer1_Tick(Object sender, EventArgs e) in C:\ENTWICKLUNG\QUISY70\MODULE\IS_MARKTPLATZ\QPSIEX70\QPSIEX70\frmHauptformular.vb:Zeile 368.
    bei System.Windows.Forms.Timer.OnTick(EventArgs e)
    bei System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
    bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
    bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
    bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
    bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
    bei System.Windows.Forms.Application.Run(ApplicationContext context)
    bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
    bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
    bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
    bei QPSIEX70.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:Zeile 81.
    bei System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
    bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
    bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
    bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
    bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
    bei System.Threading.ThreadHelper.ThreadStart()
    InnerException: System.NullReferenceException
    HResult=-2147467261
    Message=Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
    Source=MWSClientCsRuntime-1.0
    StackTrace:
    bei MWSClientCsRuntime.MwsUtil.CleanWS(String s)
    bei MWSClientCsRuntime.MwsUtil.EscapeAppName(String s)
    bei MWSClientCsRuntime.MwsConnection.SetDefaultUserAgent()
    bei MWSClientCsRuntime.MwsConnection.freeze()
    bei MWSClientCsRuntime.MwsConnection.NewCall(String servicePath, String operationName)
    bei MWSClientCsRuntime.MwsConnection.Call[T](IMwsRequestType`1 type, IMwsObject requestData)
    InnerException:

    Hat noch jemand eine Idee?