URL Registration & Reservation and Casablanca C++ REST

Hi,
I really need help. I have an application that uses Casablanca C++ REST to create a web server to communicate over a port on localhost. My problem is that it works well when using 127.0.0.1 but requires 'Run as Admin'. 
To get round this issue, I need to use 'localhost'. However, my application no longer works when I use 'localhost' and will not talk to the client app.
I understand I need to reserve the url on Windows which I have done using netsh commands, but I also need to register the url in the application so a listen list is created. I think I have achieved this with the code below, although I haven't verified it,
it does compile and run without throwing any exceptions.
My question is: now that I have added my url to the Windows group to allow the application to listen, how do I pass this (handle?) to the Casablanca code that separately creates a http_listener of it's own. My Casablanca code is based on the BlackJack
Dealer sample code.
Edit: I have discovered that my application is actually working and it's the client application that for some reason does not work on localhost. I have left this post up in case the code is of use to anyone.
Many thanks,
Andy
HTTPAPI_VERSION apiVersion = HTTPAPI_VERSION_2;
auto result = HttpInitialize(apiVersion, HTTP_INITIALIZE_SERVER, 0);
if (NO_ERROR != result) return 0;
std::cout << "HTTP initialized." << std::endl;
HANDLE reqQueue = 0;
result = HttpCreateRequestQueue(apiVersion, NULL, NULL, 0, &reqQueue);
if (NO_ERROR != result)
cleanup1();
return 0;
std::cout << "HTTP request queue created." << std::endl;
HTTP_SERVER_SESSION_ID serverSessionId = 0;
result = HttpCreateServerSession(apiVersion, &serverSessionId, 0);
if (NO_ERROR != result)
cleanup2(reqQueue);
cleanup1();
return 0;
std::cout << "HTTP server session created." << std::endl;
HTTP_URL_GROUP_ID urlGroupId = 0;
result = HttpCreateUrlGroup(serverSessionId, &urlGroupId, 0);
if (NO_ERROR != result)
cleanup3(serverSessionId);
cleanup2(reqQueue);
cleanup1();
return 0;
std::cout << "Url group created." << std::endl;
result = HttpAddUrlToUrlGroup(urlGroupId, L"http://localhost:27016/", NULL, 0);
if (NO_ERROR != result)
cleanup4(urlGroupId);
cleanup3(serverSessionId);
cleanup2(reqQueue);
cleanup1();
return 0;
std::cout << "Url added to group." << std::endl;
class BlackJackDealer
public:
BlackJackDealer() {}
BlackJackDealer(utility::string_t url);
pplx::task<void> open() { return m_listener.open(); }
pplx::task<void> close() { return m_listener.close(); }
private:
void handle_get(http_request message);
http_listener m_listener;
void on_initialize(const string_t& address)
// Build our listener's URI from the configured address and the hard-coded path
UINT16 ret;
uri_builder uri(address);
auto addr = uri.to_uri().to_string();
g_httpDealer = std::unique_ptr<BlackJackDealer>(new BlackJackDealer(addr));
g_httpDealer->open().wait();
ucout << utility::string_t(U("Listening for requests at: ")) << addr << std::endl;
BlackJackDealer::BlackJackDealer(utility::string_t url) : m_listener(url)
m_listener.support(methods::GET, std::bind(&BlackJackDealer::handle_get, this, std::placeholders::_1));

Hello andy,
Since this issue is related with VC++, i suggest that you could post it to the VC++ forum:
https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=vcgeneral
I notice that you are using the Casablanca C++ REST API, you coudl also ask it at:
https://casablanca.codeplex.com/
Regards.
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.

Similar Messages

  • In Pages 5, Maverick, How do I stop automatic conversation of URLs to hyperlinks and seeing them underlined

    There used to be a preference setting in Pages.  Now it seems gone in Pages 5.   So how do I stop automatic conversation of URLs to hyperlinks and seeing them underlined in text.  Sometimes I want it, but not always.

    The preference setting to turn off links is gone. When you enter content that triggers link detection, a link character style gets applied. Right-click on the link, choose Edit Link from the menu, and then Remove.
    To prevent Pages from automatically detecting links, visit Edit > Substitutions > and deselect Smart Links.

  • My ipod touch is locked up we dont know how it happened and it will not restore also could u trade a ipod touch 3g for a ipod touch 4g and pay the rest of it

    my ipod touch is locked up we dont know how it happened and it will not restore also could i trade a ipod touch 3g for a 4g and pay the rest for it

    my sister got on my ipod and i have never put a passcode on it but we bought it from someone and havent had it long and i've tried to restore it and it said it needed a update. it update but it didnt restore, i tried it agian it did the same thing
    how much would be 10% oof it

  • Just bought a new imac and tried to download all my music from my iPod but it only allow me to download purchased items and not the rest of stuff stored on a previous pc itunes folder. How do I get round this ?

    Just bought a new imac and tried to download all my music from my iPod but it only allow me to download purchased items and not the rest of stuff stored on a previous pc itunes folder. How do I get round this ?

    The simplest way to transfer everything is to copy the entire /Music/iTunes/ folder from old computer to /Music/ on new computer.
    See "External Drive" in this article-> iTunes: How to move your music to a new computer

  • I have registered Adobe CS, and every two/three weeks i get a message that I am using a trial version.  I provide my registration key, and the fun starts over in two/three weeks.  What is going on?

    I have registered Adobe CS, and every two/three weeks i get a message that I am using a trial version.  I provide my registration key, and the fun starts over in two/three weeks.  What is going on?

    I'm not sure what's happening. See if you can get some help from Web Chat here:
    Serial number and activation support

  • Hello! I have the Acrobat XI test version installed, got the registration Mail and confirmed it. When i have the program opened and try to convert the file from a pdf to a word and press the convert button, it shows a the message "application failed" (in

    Hello! I have the Acrobat XI test version installed, got the registration Mail and confirmed it. When i have the program opened and try to convert the file from a pdf to a word and press the convert button, it shows a the message "application failed" (in german "Fehler bei der Anmeldung"). I hope have explained the issue on the right way with my bad english. Do you have a solution for it?? Best regards, Marcus Wenk

    yes, you are right. it is the adobe reader via exportPDF. but it should be the acrobat. it was written on the internetpage...

  • Using url with username and password in URL class

    Hi,
    I'm writting an applet in which I use getAppletContext().showDocument with an URL.
    The problem is that I'm using URLs with username and password (http://user:[email protected]/page) and it isn't working because the browser is getting the URL http://user/page.
    Is this a bug in the URL class? Or in the showDocument method?
    Is there any way to make this work?
    Thanks for any help,
    Pedro Prospero Luis ([email protected])

    I'm not sure whether this is supported behaviour. I've had this syntax fail to work in the Netscape address bar so I can't recommend it as an approach for authentication.
    If you want to authenticate the user before redirecting to the page, though, you could try creating a connection to another page on the same server and sending the authorization information then. Your browser may then be successfully authenticated.
    See http://www.javaworld.com/javatips/jw-javatip47.html for information on this.
    You might not need to read back the page from the server, just connect to it. Might work.

  • I´d like to cancel my big CC plan and switch to photo plan. I need Ohotoshop, Lightromm and Acrobat, the rest are obsolete to me

    I´d like to cancel my big CC plan and switch to photo plan. I need Ohotoshop, Lightromm and Acrobat, the rest are obsolete to me

    Hi Tore,
    You can follow the article: Cancel your membership or subscription | Creative Cloud to cancel your subscription.
    Let us know if you still need any help with that.
    Thanks,
    Ratandeep Arora

  • Issuance is not updating in Reservation and MD04

    Hi folks!!
    I am getting a problem in stock issuance.
    While issuing against reservation created for production order, for some material the issued quantity is not getting updated in the withdrawl field in reservation, and it is also not getting updated in MD04.
    what could be the possible reason. Please help
    Best regards,

    I got the answer,
    We need to create production planning option in Consumption Based Planning--plant parameters.

  • How can I order an iphone 6 and pick it up from one of the apple stores in London. It doesn't work with reserve and pick up because the 64 gb is never in stock.

    How can I order an iphone 6 and pick it up from one of the apple stores in London??? It doesn't work with reserve and pick up because the 64 gb is never in stock.

    Thank you for replying.    Yes I deleted the old email address..   

  • How can I select several emails from 3900 on my 5c and delete the rest easily

         How can I select several emails from 3900 on my 5c and delete the rest easily

    We'll I don't think there's a easy way to delete a lot of emails besides deleting all of them. To delete all of them click on inbox them edit then "mark all" then trash/delete. Other than that you will have to specifically deleted the ones you want to delete.

  • Oracle reserved and non-reserved keywords

    Hello,
    I'm looking for a list of reserved and non-reserved keywords for all Oracle versions starting from 9.
    I think Oracle starts at R1, right? So the versions needed would be:
    9.1, 9.2
    10.1, 10.2 and
    11.1
    I found lists of keywords querying Oracle view V$RESERVED_WORDS
    http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14237/dynviews_2048.htm#REFRN30204
    here:
    http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14200/ap_keywd.htm
    However, this is only for version 10.2 and it contains only reserved keywords.
    I need a list for every maintenance/minor version. This list must contain all keywords in Oracle PL/SQL, not just the reserved ones, but also those which shouldn't be used in certain contexts described by the V$RESERVED_WORDS view (former link) -> probably reserved = 'N'.
    Since I don't own a copy of Oracle and definitely not of every minor version, does anyone know where to obtain such lists?
    You might want to do me a favor and query that view for me... ;-) (you can send the output to "k w u t z k e AT w e b DOT d e" ... don't forget to mention the version)
    From what the view tells me, the SQL statements to query are:
    For reserved words:
    select keyword from v$reserved_words where reserved='Y' order by keyword;
    For all other non-reserved words:
    select keyword from v$reserved_words where reserved='N' order by keyword;
    Are there any keywords/entities that are neither reserved='Y' nor reserved='N'?
    Can anyone help on this issue please?
    TIA,
    Karsten

    Not sure about differences between specific versions but the easy way to get reserved words is in SQL*Plus...
    SQL> help reserved words
    RESERVED WORDS (PL/SQL)
    PL/SQL Reserved Words have special meaning in PL/SQL, and may not be used
    for identifier names (unless enclosed in "quotes").
    An asterisk (*) indicates words are also SQL Reserved Words.
    ALL*            DESC*           JAVA            PACKAGE         SUBTYPE
    ALTER*          DISTINCT*       LEVEL*          PARTITION       SUCCESSFUL*
    AND*            DO              LIKE*           PCTFREE*        SUM
    ANY*            DROP*           LIMITED         PLS_INTEGER     SYNONYM*
    ARRAY           ELSE*           LOCK*           POSITIVE        SYSDATE*
    AS*             ELSIF           LONG*           POSITIVEN       TABLE*
    ASC*            END             LOOP            PRAGMA          THEN*
    AT              EXCEPTION       MAX             PRIOR*          TIME
    AUTHID          EXCLUSIVE*      MIN             PRIVATE         TIMESTAMP
    AVG             EXECUTE         MINUS*          PROCEDURE       TIMEZONE_ABBR
    BEGIN           EXISTS*         MINUTE          PUBLIC*         TIMEZONE_HOUR
    BETWEEN*        EXIT            MLSLABEL*       RAISE           TIMEZONE_MINUTE
    BINARY_INTEGER  EXTENDS         MOD             RANGE           TIMEZONE_REGION
    BODY            EXTRACT         MODE*           RAW*            TO*
    BOOLEAN         FALSE           MONTH           REAL            TRIGGER*
    BULK            FETCH           NATURAL         RECORD          TRUE
    BY*             FLOAT*          NATURALN        REF             TYPE
    CHAR*           FOR*            NEW             RELEASE         UI
    CHAR_BASE       FORALL          NEXTVAL         RETURN          UNION*
    CHECK*          FROM*           NOCOPY          REVERSE         UNIQUE*
    CLOSE           FUNCTION        NOT*            ROLLBACK        UPDATE*
    CLUSTER*        GOTO            NOWAIT*         ROW*            USE
    COALESCE        GROUP*          NULL*           ROWID*          USER*
    COLLECT         HAVING*         NULLIF          ROWNUM*         VALIDATE*
    COMMENT*        HEAP            NUMBER*         ROWTYPE         VALUES*
    COMMIT          HOUR            NUMBER_BASE     SAVEPOINT       VARCHAR*
    COMPRESS*       IF              OCIROWID        SECOND          VARCHAR2*
    CONNECT*        IMMEDIATE*      OF*             SELECT*         VARIANCE
    CONSTANT        IN*             ON*             SEPERATE        VIEW*
    CREATE*         INDEX*          OPAQUE          SET*            WHEN
    CURRENT*        INDICATOR       OPEN            SHARE*          WHENEVER*
    CURRVAL         INSERT*         OPERATOR        SMALLINT*       WHERE*
    CURSOR          INTEGER*        OPTION*         SPACE           WHILE
    DATE*           INTERFACE       OR*             SQL             WITH*
    DAY             INTERSECT*      ORDER*          SQLCODE         WORK
    DECIMAL*        INTERVAL        ORGANIZATION    SQLERRM         WRITE
    DECLARE         INTO*           OTHERS          START*          YEAR
    DEFAULT*        IS*             OUT             STDDEV          ZONE
    DELETE*         ISOLATION
    RESERVED WORDS (SQL)
    SQL Reserved Words have special meaning in SQL, and may not be used for
    identifier names unless enclosed in "quotes".
    An asterisk (*) indicates words are also ANSI Reserved Words.
    Oracle prefixes implicitly generated schema object and subobject names
    with "SYS_". To avoid name resolution conflict, Oracle discourages you
    from prefixing your schema object and subobject names with "SYS_".
    ACCESS          DEFAULT*         INTEGER*        ONLINE          START
    ADD*            DELETE*          INTERSECT*      OPTION*         SUCCESSFUL
    ALL*            DESC*            INTO*           OR*             SYNONYM
    ALTER*          DISTINCT*        IS*             ORDER*          SYSDATE
    AND*            DROP*            LEVEL*          PCTFREE         TABLE*
    ANY*            ELSE*            LIKE*           PRIOR*          THEN*
    AS*             EXCLUSIVE        LOCK            PRIVILEGES*     TO*
    ASC*            EXISTS           LONG            PUBLIC*         TRIGGER
    AUDIT           FILE             MAXEXTENTS      RAW             UID
    BETWEEN*        FLOAT*           MINUS           RENAME          UNION*
    BY*             FOR*             MLSLABEL        RESOURCE        UNIQUE*
    CHAR*           FROM*            MODE            REVOKE*         UPDATE*
    CHECK*          GRANT*           MODIFY          ROW             USER*
    CLUSTER         GROUP*           NOAUDIT         ROWID           VALIDATE
    COLUMN          HAVING*          NOCOMPRESS      ROWNUM          VALUES*
    COMMENT         IDENTIFIED       NOT*            ROWS*           VARCHAR*
    COMPRESS        IMMEDIATE*       NOWAIT          SELECT*         VARCHAR2
    CONNECT*        IN*              NULL*           SESSION*        VIEW*
    CREATE*         INCREMENT        NUMBER          SET*            WHENEVER*
    CURRENT*        INDEX            OF*             SHARE           WHERE
    DATE*           INITIAL          OFFLINE         SIZE*           WITH*
    DECIMAL*        INSERT*          ON*             SMALLINT*
    SQL>If you haven't got oracle then I'm not sure where you're going to find out all the minor differences I'm afraid.

  • Related to Reservation and Goods Issue

    Hi SAP Gurus,
    Reservation Created for Materials A,B,C on 16th of Augest and Stock was not available on that day.
    Goods came on after 20th Aug and I am creating Goods Issue for A,B,C and For A i can create Goods Issue against that reservation and for B,C the system throughing an error that Stock not available on 15.02.2009.
    Please suggest me immediately,
    Thanks

    Hi,
    Go to co06 & check for mtl B & C if the stock is pegged for other requirements. It could be the reason system is prompting so. Also just check if the stock is in unrestricted or in QI stock.
    Check & revert if it does not resolve the issue.
    If helpful award points
    Regards,
    Vivek

  • SOAP URL without username and password

    Hello Everyone,
    its a synchronous SOAP - PI -ECC scenario .
    I have created HTTP URL through sender agreement in integration for testing.
    However, customer now wants HTTPS URL without Username and password in  production URL. How do i create this .
    Regards,
    Ravi

    Hello,
    However, customer now wants HTTPS URL without Username and password in production URL. How do i create this .
    You can disable basic authentication for the sender SOAP Adapter by following William's reply in this thread
    http://forums.sdn.sap.com/thread.jspa?threadID=236507
    However, the authentication will be disabled for all SOAP Sender, so you should weigh-in the impacts of granting that request.
    Hope this helps,
    Mark
    Edited by: Mark Dihiansan on Feb 13, 2012 3:51 AM

  • Adobe Revel?  I have forgotten:  the URL; my username and password.  How do I ask Adobe for these items?  Thanking your reply !!!

    Adobe Revel? I have forgotten: the URL; my username and password. How do I ask Adobe for these items? Thanking your reply !!!
    [email protected]

    Dave,
    No worries, this link will help you with your issues. You do have a revel account with that email, so resetting your password should be all you need to do. Just click on the "I forgot my password" link on the web page listed below:
    http://helpx.adobe.com/x-productkb/policy-pricing/account-password-sign-faq.html
    Once you reset your password, you should be able to login to revel at adoberevel.com on a browser or from one of our apps on mac, ios, win8, or android.
    Pattie

Maybe you are looking for