locked
C++/CX and Amazon Advertising API

    Question

  • This is my first time posting on the MSDN forms so I hope I've posted this in the correct place, my apologies if I haven't.

    Language: C++/CX & XAML
    Environment: Visual Studio 2013 on Windows 8.1

    I am trying to use the Amazon Product Advertising API in my Windows Store app.  I have an Associates account so I am allowed to use this however I'm having problems implementing the .wsdl file after using wsutil.exe to create a .c and .h file for my project.

    The .c and .h files both have errors pointing to identifiers that reside inside WebServices.h. 

    Since the .c and .h files have a combined length of more than 13k lines of code I'll write out steps to reproduce my problem.

    -Navigate to http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl

    -Save the file either in a project fold or on the desktop

    -Open up a VS2013 command prompt and navigate to where the file resides

    -Type "wsutil /wsdl:AWSECommerceService.wsdl"
          This produces the .c and .h files that can be used in the project

    -Add the .c and .h files to a VC++ Windows Store app project

    since the environment language is C++/CX and wsutil gave us a .c file we need to tell the compiler to treat this file as a C++ file otherwise if you try to build like it is it throws an error saying:

    Command line error D8048: cannot compile C file '..\..\New folder\AWSECommerceService.wsdl.c' with the /ZW option

    My first attempt at trying to fix this was to remove the /ZW option.
    This can be done by right clicking the .c file, click properties, under "General" you will will see "yes(/ZW)" which you can change to "no".

    after doing this and trying to build it gives this error:

    ...\awsecommerceservice.wsdl.c : fatal error C1853: 'Debug\SimpleShop.pch' precompiled header file is from a previous version of the compiler, or the precompiled header is C++ and you are using it from C (or vice versa)

    That wasn't the correct fix so I went back and added the /ZW option.

    Next I decided to tell the compiler to treat the .c file as a .cpp file by adding the /TP option.  You can find this by right clicking the .c file, clicking properties, click Advanced, click the drop down box next to "Compile as" and selected /TP.

    Now when trying to build the project errors appear in both the .c and .h files for identifiers that reside in the WebServices.h file.

    This is where I'm stuck at.  I tried to #include "WebServices.h" into the .h file (which is oddly missing it whereas the .c file is not) and this does nothing to remove any of the errors.

    I can find nothing about using the Amazon Product Advertising API inside a windows store app on the internet so all of the attempted fixes came from Win7 or WCF forums.  The steps I'm trying to follow are from Amazon on they can be found here (focus on step 4):

    http://docs.aws.amazon.com/AWSECommerceService/latest/GSG/GettingSetUp.html

    these are the errors:
    1>c:\users\scott\desktop\new folder\awsecommerceservice.wsdl.h(1037): error C2371: '_RelatedItems::RelatedItemCount' : redefinition; different basic types
    1>          c:\users\scott\desktop\new folder\awsecommerceservice.wsdl.h(1034) : see declaration of '_RelatedItems::RelatedItemCount'
    1>c:\users\scott\desktop\new folder\awsecommerceservice.wsdl.h(1576): error C2061: syntax error : identifier 'WS_SERVICE_SECURITY_CALLBACK'
    1>c:\users\scott\desktop\new folder\awsecommerceservice.wsdl.h(1604): error C2061: syntax error : identifier 'WS_SERVICE_SECURITY_CALLBACK'
    1>c:\users\scott\desktop\new folder\awsecommerceservice.wsdl.h(1632): error C2061: syntax error : identifier 'WS_SERVICE_SECURITY_CALLBACK'
    1>c:\users\scott\desktop\new folder\awsecommerceservice.wsdl.h(1660): error C2061: syntax error : identifier 'WS_SERVICE_SECURITY_CALLBACK'
    1>c:\users\scott\desktop\new folder\awsecommerceservice.wsdl.h(1688): error C2061: syntax error : identifier 'WS_SERVICE_SECURITY_CALLBACK'
    1>c:\users\scott\desktop\new folder\awsecommerceservice.wsdl.h(1716): error C2061: syntax error : identifier 'WS_SERVICE_SECURITY_CALLBACK'
    1>c:\users\scott\desktop\new folder\awsecommerceservice.wsdl.h(1744): error C2061: syntax error : identifier 'WS_SERVICE_SECURITY_CALLBACK'
    1>c:\users\scott\desktop\new folder\awsecommerceservice.wsdl.h(1772): error C2061: syntax error : identifier 'WS_SERVICE_SECURITY_CALLBACK'
    1>c:\users\scott\desktop\new folder\awsecommerceservice.wsdl.h(1800): error C2061: syntax error : identifier 'WS_SERVICE_SECURITY_CALLBACK'
    1>c:\users\scott\desktop\new folder\awsecommerceservice.wsdl.h(1828): error C2061: syntax error : identifier 'WS_SERVICE_SECURITY_CALLBACK'
    1>c:\users\scott\desktop\new folder\awsecommerceservice.wsdl.h(1856): error C2061: syntax error : identifier 'WS_SERVICE_SECURITY_CALLBACK'
    1>c:\users\scott\desktop\new folder\awsecommerceservice.wsdl.h(2709): error C2146: syntax error : missing ';' before identifier 'AWSECommerceServiceBinding'
    1>c:\users\scott\desktop\new folder\awsecommerceservice.wsdl.h(2709): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\users\scott\desktop\new folder\awsecommerceservice.wsdl.c(1159): error C2146: syntax error : missing ';' before identifier 'contractDesc'
    1>c:\users\scott\desktop\new folder\awsecommerceservice.wsdl.c(1159): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\users\scott\desktop\new folder\awsecommerceservice.wsdl.c(6674): fatal error C1903: unable to recover from previous error(s); stopping compilation

    Wednesday, April 30, 2014 7:21 PM

Answers

  • Hi,

    According to your description i am afraid your problem is out of support in windows store app. Amazon Product Advertising API is a 3th part product. About question about Amazon Product Advertising API, you should go to the forum below to post your thread:

    https://forums.aws.amazon.com/forum.jspa?forumID=9

    Best Wishes!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey. Thanks<br/> MSDN Community Support<br/> <br/> Please remember to &quot;Mark as Answer&quot; the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Thursday, May 1, 2014 7:29 AM

All replies

  • So I have been made aware that WebServices.h is for desktop apps only.  Is there a way around this dependency that I haven't thought of?  The only other option I can think of is to create a website that uses the Amazon Product Advertising API and load this site in my app, which I was trying to avoid so if there is a way around this I would very much appreciate an answer.

    side note: This whole problem has made me wonder why Amazon isn't updating their APIs for new technologies like windows store apps.  Especially since xp isn't supported by Microsoft anymore.
    Wednesday, April 30, 2014 9:36 PM
  • Hi,

    According to your description i am afraid your problem is out of support in windows store app. Amazon Product Advertising API is a 3th part product. About question about Amazon Product Advertising API, you should go to the forum below to post your thread:

    https://forums.aws.amazon.com/forum.jspa?forumID=9

    Best Wishes!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey. Thanks<br/> MSDN Community Support<br/> <br/> Please remember to &quot;Mark as Answer&quot; the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Thursday, May 1, 2014 7:29 AM