SubmitGenerateReportAsync Issue. Await operator can only be used with Async Method

Hi,
I am trying to submit a request to download keyword performance report using following .
 var reportId =await SubmitGenerateReportAsync(reportRequest); its giving me error 
The 'await' operator can only be used within an async method. Consider marking this method with the 'async' modifier and changing its return type to 'Task'.
Here is the SubmitGenerateReportAsync method. I am already using async in definition. Not sure what else is wrong.
 private async Task<string> SubmitGenerateReportAsync(ReportRequest report)
            var request = new SubmitGenerateReportRequest
                ReportRequest = report
            return (await Service.CallAsync((s, r) => s.SubmitGenerateReportAsync(r), request)).ReportRequestId;
Same issue with PollGenerateReportAsync
 reportStatus =await PollGenerateReportAsync(reportId.ToString());
  private async Task<ReportRequestStatus> PollGenerateReportAsync(string reportId)
            var request = new PollGenerateReportRequest
                ReportRequestId = reportId
            return (await Service.CallAsync((s, r) => s.PollGenerateReportAsync(r), request)).ReportRequestStatus;
Let me know if its easy fix.

I fixed the link to our
code example which shows how to run such a report from the console. You would create async methods, run, and wait from within Main.
/// <summary>
/// The entry point for the console application.
/// </summary>
/// <param name="args">Arguments are not required for this example.</param>
public static void Main(string[] args)
var example = new KeywordPerformance();
Console.WriteLine(example.Description);
try
var authentication = new PasswordAuthentication(
"<UserNameGoesHere>",
"<PasswordGoesHere>");
// The OAuthHelper class is available for download with the BingAdsExamples solution.
// OAuthDesktopMobileImplicitGrant authentication = await OAuthHelper.AuthorizeImplicitly();
var authorizationData = new AuthorizationData
Authentication = authentication,
CustomerId = <CustomerIdGoesHere>,
AccountId = <AccountIdGoesHere>,
DeveloperToken = "<DeveloperTokenGoesHere>"
example.RunAsync(authorizationData).Wait();
catch (Exception ex)
Console.WriteLine(ex.Message);
Best regards,
Eric

Similar Messages

  • Item category S can only be used with account assignment category

    Hello Gurus,
    When i tried to create a PO then error "Item category S can only be used with account assignment category" is coming
    for my plant and material.
    Could you please tell me where i have to maintain the setting of account assignement for a plant or material.
    In TA:-OMG0 item catergory S is maintained for a account assignement F but still this issue is coming.
    I think there is a problem in plant or a material.
    Please help me.
    BR

    Hi,
    How you are creating PO  ,so that you have error "Item category S can only be used with account assignment category"
    Check what t.code used for your PO creation and what document type used for your PO creation- which result defaulting item category S which in turn asking for  with account assignment category.
    Cross check transaction variant or screen variant used for your PO creation!
    Regards,
    Biju K

  • GroupLayout can only be used with one Container at a time

    Dear all,
    I am a beginner so please don't throw rocks at me...
    I have created two frames with NetBeans. One is the main frame (extends from JPanel) and the other frame I put it to be started when pressing a button from the main frame (the second frame extends from JFrame). Both frames are created using the designer in NetBeans, so the code for creating the GUI is automatically generated by NetBeans, so both frames use the same layout (GroupLayout).
    Here is the code of the button from the main frame to start the second one:
    private void manageCustomersActionPerformed(java.awt.event.ActionEvent evt) {                                                
            // TODO add your handling code here:
            CustomerGUI custGUI1=new CustomerGUI();//CustomerGUI is the second frame
            custGUI1.setVisible(true);
    }When I press this button from the main frame I get this runtime exception: Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: GroupLayout can only be used with one Container at a time. The second frame is not opened.
    How should I handle this?
    What I want to do: I want to have a main frame, from which I can start additional ones (the main frame must be always opened, while the additional ones can be closed after performing certain actions). I read a little about internal frames and I think this can be a solution, but I must edit the existing design...
    Thank you
    With respect,
    Don
    Edited by: don1983p on Dec 16, 2008 2:21 AM

    AndrewThompson64 wrote:
    There are those that maintain that JFrame should never be extended. I am not convinced, but most cases where a JFrame is extended would be better coded as simply configuring the JFrame within the main(). GUI builders such as found in NetBeans seem to extend JFrame as a matter of course.I too am not rigorous or religious about this either, but try to adhere to this as a matter of practicality and convenience, I find that if I don't extend a JComponent but rather use composition rather than inheritance, it's much easier to use objects of my class when programming in Eclipse. For instance in Eclipse (and in most IDEs), if I type my object name and then a period, it will show all of the method's available for me to use on this object. If I subclass JPanel or JFrame, I'll see a gazillion methods most I don't want to see, and thus most are clutter. On the other hand if I use composition, I'll only see a small number of methods and these will be only the methods that I want to see and need to use.

  • Fedex can only be used with dreamweaver using metric, not pounds (lbs)

    Fedex can only be used with dreamweaver using metric, not pounds (lbs), evidently?
    This as per their tier 2 tech suport.
    They say I should just convert to metric, no joke!
    Any ideas would be greatly appreaciated?
    Also a warning to anyone thinking of using business catalyst for their site, sorry, their business.
    Their note to me:
    Your request (# 82816) has been solved. To reopen this request, reply to this email or go to the Help & Support page.
                  Silviu Ghimposanu (Adobe Business Catalyst Support)           
                  Apr 14 15:23           
        Thanks for contacting us Michael  
    Our engineering team has detected some problems when doing weight conversions (from the quantities entered in the interface to what’s used when making the API calls to FedEx) -
      He have added this to our internal bug tracker to be fixed for one of the future releases. 
        I realise that this might not be what you wanted to hear,but at this moment we do't have a workaround in order to send the
      dimensions in pounds and not in KG 
        Sorry for this inconvenience!
      Kind regards, 

    If you're in US it will be in pounds. If your site is set any other country
    in the rest of the world it will be metric. So BC or as you call it
    Dreamweaver will look at the site country, which you set when creating the
    site

  • Item category D can only be used with account assignment category

    Dear Guru's,
    While creating service PO, i am getting d above error
    wat it is ? Is it mandatory to maintain Ac assignment cat along with item cat for service PO ?
    regds,
    CB

    hi
    Item category D is used for services .services can not be stocked like stock item... these are for direct consumption hence account assignment is mandatory for Item category D
    u can enter K or U as account assignment and proceed with PO creation
    Vishal...

  • Is there any other ways to check whether is my phone faulty or my sim card issue. I can only use it for call, my network to 3G or 4G suddenly cannot use.

    Is there any other ways to check whether is my phone faulty or my sim card issue. I can only use it for call, my network to 3G or 4G suddenly cannot use. This happen since yesterday, suddenly can use but suddenly cut off. Called Telco and they reset account but still same.

    See this
    http://support.apple.com/kb/TS4148

  • Using windows vista with two users and I can only open books with adobe digital editions on one account?

    using windows vista with two users and I can only open books with adobe digital edition

    You must authorize the second computer with the same Adobe ID.
    There are sometimes issues with this registration: if you have them ....
    Sometimes ADE gets its registration/activation confused and in a semi-authorized state.
    Uninstalling and reinstalling does not help.
    Unfortunately, it often then gives misleading error messages about what is wrong.
    A common incorrect message informs you that the ID is already in use on another computer and cannot be reused.
    This can often be resolved by completely removing any authorization using ctrl-shift-D to the Library screen on ADE (cmd-shift-D if on Mac).
    Restart ADE, and then reauthorize with your (old) Adobe ID.

  • Alternatives can only be used once?

    Hi
    In the Adobe form when creating an alternative I've discovered that it can only be used once.
    Is this correct?
    I've created an alternative e.g. name = FLAG_IS_X condition flag = X.
    When I use the alternative 'FLAG_IS_X' the first time it works as required.
    However, when I use it a second time on the form it does not work at all.
    Does this mean that a different alternative with the same condition has to be created even though the condition you want to use is the same?
    Thanks

    Hey,
    Well I stumble it seems on the same 'issue' . I have 3 master pages and have the requirement to put a watermark on it depending on the status. The first master is in portrait and contains the contact details, the second master page contains the line items and is in landscape and the third one contains the totals and is back portrait.
    First I had only one alternative and used it on the 3 masterpage to check if the watermark had to be printed. In this case it was only correct for the first page (contact-info) the rest all received the mark although they should not.
    Then I made 3 altenatives (one for each type of master page) all checking the same condition.
    This way it was correct for page 1 (contacts), the first page of the items (the two others had the watermark although they should not - so not correct) and the last page with the totals.
    In my case the contacts-page and totals-page can only have a page-count of 1 but I'm almost sure that if they could have a page count of 2 or more then only the first page would be correctly printed.
    Is this a bug you think?
    Faaiez,
    Did you find in the end a workaround for this?
    Otto.
    Any suggestion of how I could handle this with scripting (no experience with scripting though)
    Anyway tnx already for all the input !!
    best regards,
    Bart V.

  • Verizon iPhone 5, 64GB black - is anyone having issues with a very choppy conversation while talking on the phone.  Both my wife and I have the same phones and are both having the same issue.  We can only hear every other word.

    Verizon iPhone 5, 64GB black - is anyone having issues with a very choppy conversation while talking on the phone?  Both my wife and I have the same phones and are both having the same issue.  We can only hear every other word of the person we are talking to.  This happens at home, on the road and in the downtown area while calling both cellphones and landlines. It is intermittent, so we don't know exactly when it will reoccur.  Absolutely no problem with data.  The data speed is great.

    "Wireless devices use radio transmissions, so unfortunately you can't get Service if your device isn't in range of a transmission signal. And please be aware that even within your Coverage Area, many things can affect the availability and quality of your Service, including network capacity, your device, terrain, buildings, foliage and weather."
    Customer Agreement | Verizon Wireless
    While there may be an issue in your area, it is suggested that you don't use wireless service if it's a life or death situation, such as the one you've described.

  • Re:  "Item category K can only be used without account assignment"

    Hi,
    while creating PO from PR the following error is coming.
    "Item category K can only be used without account assignment"
    How to solve this
    Regards,

    Hello,
    Item category K cannot be used with an account assignment as the goods are not physically used in the company. The stock is stilla consignment stock and belongs to vendor. Using an account assignment will book the cost in the company's expenses.
    use an account assignment if required when you transfer from consignment to own stock.
    Hope this helps,
    Regards,
    VS

  • Condition type PR00 can only be used once

    Hi Experts,
    Im faced with a strange problem. Request your help in resolving it.
    I tried to create my own pricing procedure by copying from RVAA01. Then i deleted all the steps and created my own steps. But when im trying to save the document, it says PR00 can only be used once. I deleted this condition type and tried to save it, it again says K004 can only be used once. Even after deleting all the earlier conditions which i copied from RVAA01, why am i getting this error.
    Your help is most appreciated.
    Warm regards,
    Sarat.

    You have deleted a row (i.e. condition type, say PR00).
    After that click icon "Save".
    Then when you create condition type PR00, system shall accept it.
    Currently, you are deleting a condition type (PR00) but it is still "in memory" of the pricing procedure. You can not create the same condition type more than once in a pricing procedure. Therefore you can not create PR00 again & you are getting the error message.
    First remove PR00 from the memory of the pricing procedure by clicking "Save", & then you can re-enter the same cond type.

  • Version 4.2.6(8E200) bought this from Apple, NewYork. Can this be used with any CDMA or only Verizon?

    version 4.2.6(8E200) bought this from Apple, NewYork. Can this be used with any CDMA or only Verizon?

    Apple's response: Sorry, only verizon
    Person in back alley wearing overcoats response : Step this way

  • AIR 3.8.0.440 / iOS: build fails with "ld: -pie can only be used when targeting iOS 4.2 or later"

    With AIR 3.8.0.440, iOS build with "adt -package -target ipa-ad-hoc" fails with a linker error:
    ld: -pie can only be used when targeting iOS 4.2 or later
    What's the correct option to suppress this error or does it need a fix for adt?
    In the app.xml,
    <key>MinimumOSVersion</key>
                <string>5.0</string>
    is already present in the iPhone InfoAdditions section.
    (Building the same app with AIR 3.8.0.370 is fine)

    Hi,
    Can you make sure that both your old ane and new ane are not present in your extensions directory.
    Also, how are you zipping/unzipping the ANE?
    If you are on a Mac, try these steps on the terminal:
    1) Create a new temp directory, say temp (mkdir temp)
    2) cd temp
    3) Copy the ane you need to make changes to into this directory.
    4) unzip nameofane.ane
    5) rm nameofane.ane
    6) Make changes to the platform.xml file using a text editor or vim
    7) cd to the temp directory again, (if you are now elsewhere)
    8) zip -r nameofane.ane .
    9) Copy the ane file created into your extensions directory, where you have placed the other extensions and then, package the IPA using adt.
    If you are on Win,
    1) Rename the .ane to .zip
    2) Extract the contents of .zip
    3) Make changes to platform.xml and save it.
    4) Go back to the directory where you extracted the files, select all the folders/files and right click to zip them back.
    5) Rename the .zip to .ane and then, package the IPA.
    It should work.

  • Session state can only be used when enablesessionstate is set to true.

    When I try to open up a certain webpage it says; Session state can only be used when enablesessionstate is set to true. What does it mean and what should I do?

    Contact the webmaster for that site and report the problem.

  • Problem with ANE - "ld: -pie can only be used when targeting iOS 4.2 or later"

    I'm trying to compile a simple AIR Mobile app for iOS, incorporating an ANE to support Localytics
    http://flashsimulations.com/2012/06/18/localytics-adobe-air-native-extension/
    Compilation fails with the message "ld: -pie can only be used when targeting iOS 4.2 or later"
    Surely 7.0 is later than 4.2! (I'm using Flex 4.6 - AIR 3.9 SDKS). Tried building with FDT and with Flash CC, and against earlier versions of the iOS SDK (6.0, 5.0).
    Any suggestions?

    thanks, but can you be more specific? Presumably I add something in this part:
        <iPhone>
            <InfoAdditions><![CDATA[<key>UIDeviceFamily</key>
                                                  <array>
                                                      <string>1</string>
                                                      <string>2</string>
                                                  </array>
                                                  <key>UIStatusBarStyle</key>
                                                  <string>UIStatusBarStyleBlackOpaque</string>
                                                  <key>UIRequiresPersistentWiFi</key>
                                                  <string>YES</string>]]></InfoAdditions>
            <requestedDisplayResolution>high</requestedDisplayResolution>
        </iPhone>

Maybe you are looking for

  • Purchase order Condition control tab?

    Hi, Here in the purchase order condition control tab I need to get Price Date and Price date category. Presently they are not appearing in my purchase orders. When I go to screen layout, I am not able to get those fields to configure. Could please an

  • How to set css effect on choicebox items

    Hello, i've got two questions. 1) How can i edit an "Item" of a choicebox with css? I've figured out that i can easily give my choicebox like a other background color with it's ID. But i dont know how i do it with the items in a choicebox. 2) And how

  • IPhoto 9.2 photo descriptions will not write - after a few letters words self erase!

    iPhoto 9.2 photo descriptions will not write - after a few letters words self erase! Program update downloaded earlier today, 24.10.11. Fine on my laptop, but my desktop is having problems.

  • Error when trying to view YouTube videos

    I get the following error when trying to view YouTube videos in some wireless hotspots; "The server is not correctly configured".  It used to work fine at these locations.

  • Enterprise Portals Certification

    Hi, I am planning to take certification in the coming teched. So could someone send me some questions if u have to my mail id [email protected] Thanks, Suvarna