How to set HTTP status codes from BSP

Hello,
How can I set the HTTP status code from a BSP?
I use response->set_status( code = 500 reason = 'Error') from OnInputProcessing event, but nothing happens...
Tia,
Joerg

Hi,
Thank you for the references, but unfortunately it still does not work for me.
Here's what I do in my BSP:
- The BSP displays a simple Form in which some user data
  can be entered.
- In the OnInputProcessing event handler of this BSP the
  data is analyzed. If there is an error, the following
  code is executed:
  if l_error eq 'X'.
    data:
      res type ref to if_http_response.
    res = runtime->server->response.
    res->set_status( code   = 500
                     reason = 'Internal error' ).
  endif.
- I would expect the Browser to display the error page,
  however I simply get the BSP Form again - the HTTP
  error is not shown at all.
What am I doing wrong?
Thanks, Joerg

Similar Messages

  • HTTP Status Code from NSURLResponse (iPhone)

    Hello!!
    How can I get HTTP Status Codes from a NSURLResponse (iPhone API) ??
    thx...

    statusCode
    Returns the receiver’s HTTP status code.
    - (NSInteger)statusCode
    Return Value
    The receiver’s HTTP status code.
    Availability
    Available in iPhone OS 2.0 and later.
    See Also
    + localizedStringForStatusCode:
    Declared In
    NSURLResponse.h

  • HTTP Status Code from NetConnection

    Hey flexers,
    I have a flex app that requires a user to be logged in to make service calls.  If the user isn't logged in or the session times out and the app makes a call to a backend service via AMF, the server responds with an HTTP status code 401, as expected.  The response header looks like this:
    HTTP/1.1 401 Authorization Required
    Date: Wed, 18 Aug 2010 16:49:01 GMT
    Server: Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.6 with Suhosin-Patch mod_ssl/2.2.8 OpenSSL/0.9.8g
    X-Powered-By: PHP/5.2.4-2ubuntu5.6
    x-ec2-instance-id: i-e52e8b8f
    Cache-Control: no-store, no-cache, must-revalidate
    Pragma: no-cache
    P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"
    Cache-Control: post-check=0, pre-check=0
    Content-Length: 185
    Content-Type: application/x-amf
    Expires: 0
    The response content is AMF so it's binary but here's the hex as reported by the Charles Web Debugging Proxy:
    00000000  00 00 00 00 00 01 00 0b 2f 31 2f 6f 6e 53 74 61           /1/onSta
    00000010  74 75 73 00 00 ff ff ff ff 10 00 1b 66 6c 61 73   tus         flas
    00000020  68 2e 65 76 65 6e 74 73 2e 4e 65 74 53 74 61 74   h.events.NetStat
    00000030  75 73 45 76 65 6e 74 00 04 69 6e 66 6f 10 00 06   usEvent  info 
    00000040  4f 62 6a 65 63 74 00 07 6d 65 73 73 61 67 65 02   Object  message
    00000050  00 61 59 6f 75 72 20 73 65 73 73 69 6f 6e 20 69    aYour session i
    00000060  73 20 6e 6f 20 6c 6f 6e 67 65 72 20 61 63 74 69   s no longer acti
    00000070  76 65 2e 20 20 54 68 69 73 20 69 73 20 6c 69 6b   ve.  This is lik
    00000080  65 6c 79 20 64 75 65 20 74 6f 20 69 6e 61 63 74   ely due to inact
    00000090  69 76 69 74 79 2e 20 50 6c 65 61 73 65 20 72 65   ivity. Please re
    000000a0  2d 6c 6f 67 69 6e 20 74 6f 20 63 6f 6e 74 69 6e   -login to contin
    000000b0  75 65 2e 00 00 09 00 00 09                        ue.     
    I'm looking for the proper way, in the Flex app, to figure out it's a 401 status code.  Previously, we were watching for the NetStatusEvent coming from NetConnection. If there was a info.errorCode property, we'd use that as the status code.  Otherwise, if there was an info.description property, it would normally look like "HTTP: Status 401" in which case we'd pull it out of the string (which makes me cringe just thinking about it).  However, at the moment the NetStatusEvent looks like this:
    error flash.events.NetStatusEvent (@6a7eee1)
    [inherited]
    info Object (@7f3ea79)
    code "NetConnection.Call.Failed"
    description "HTTP: Failed"
    details "http://dev.studioj.com"
    level "error"
    m_info Object (@7f3ea79)
    No status code exists in the event anywhere in the event.  After all kinds of debugging, rolling back code, etc., I can't figure out why the NetStatusEvent now has description "HTTP: Failed" instead of description "HTTP: Status 401".
    Can anyone clarify what's going on?  Thanks.

    After digging into it more, I've found that it's browser-specific behavior.  When simulating an HTTP status code of 401, in Chrome and IE I get a NetStatusEvent that looks like this:
    error flash.events.NetStatusEvent (@6c33791)
    [inherited]
    info Object (@6b14851)
    code "NetConnection.Call.Failed"
    description "HTTP: Status 401"
    details "http://aaronhardy.com/test.php"
    level "error"
    m_info Object (@6b14851)
    Notice the "description" has the status code.  In Firefox I get an event that looks like this:
    error flash.events.NetStatusEvent (@6c33791)
    [inherited]
    info Object (@6b14851)
    code "NetConnection.Call.Failed"
    description "HTTP: Failed"
    details "http://aaronhardy.com/test.php"
    level "error"
    m_info Object (@6b14851)
    Notice the status code isn't mentioned anywhere.  Is this a known issue in Firefox?  Are we really that close to being able to use real HTTP status codes yet so far away?
    Aaron

  • How to resolve HTTPS status code 404 using WinHTTP?

    I am getting status code 404 for the below code snippet.
    Note: please add `<HOSTNAME>` when you are trying to figure out the issue.
    HINTERNET m_hConnect;
    HINTERNET m_hSession;
    HINTERNET m_hRequest;
    m_hSession = WinHttpOpen(userAgent,
    WINHTTP_ACCESS_TYPE_NO_PROXY,
    WINHTTP_NO_PROXY_NAME,
    WINHTTP_NO_PROXY_BYPASS, 0);
    if (!m_hSession) {
    printf("WinHttpOpen:Error %d has occurred.",GetLastError());
    return 0;
    // connect to the IPP server on the given port
    m_hConnect = WinHttpConnect( m_hSession, <HOSTNAME>, 443, 0);
    if (!m_hConnect) {
    printf("WinHttpConnect: Error %d has occurred.",GetLastError());
    return 0;
    // Create an HTTP Request handle.
    m_hRequest = WinHttpOpenRequest(m_hConnect, L"POST" ,L"/ipp",
    L"HTTP/1.1", WINHTTP_NO_REFERER,
    WINHTTP_DEFAULT_ACCEPT_TYPES,WINHTTP_FLAG_SECURE);
    if (!m_hRequest) {
    printf("WinHttpOpenRequest:Error %d has occurred.",GetLastError());
    return 0;
    DWORD secureflags = SECURITY_FLAG_IGNORE_UNKNOWN_CA | SECURITY_FLAG_IGNORE_CERT_CN_INVALID |SECURITY_FLAG_IGNORE_CERT_WRONG_USAGE | SECURITY_FLAG_IGNORE_CERT_DATE_INVALID;
    BOOL bResult= WinHttpSetOption(m_hRequest, WINHTTP_OPTION_SECURITY_FLAGS, (LPVOID)&secureflags, sizeof(secureflags));
    if (!bResult) {
    printf("WinHttpSetOption:Error %d has occurred.",GetLastError());
    return 0;
    bResult = WinHttpSendRequest(m_hRequest, WINHTTP_NO_ADDITIONAL_HEADERS,0,WINHTTP_NO_REQUEST_DATA,0,0,0);
    if (!bResult) {
    printf("WinHttpSendRequest:Error %d has occurred.",GetLastError());
    return 0;
    if( !WinHttpReceiveResponse( m_hRequest, NULL ) )
    if( GetLastError( ) == ERROR_WINHTTP_CLIENT_AUTH_CERT_NEEDED )
    HCERTSTORE hMyStore = 0;
    PCCERT_CONTEXT pCertContext = 0;
    WCHAR szCertName[256]={0};
    //MY is the store the certificate is in.
    hMyStore = CertOpenSystemStore( 0, TEXT("MY") );
    if( hMyStore )
    pCertContext = CertFindCertificateInStore( hMyStore,
    X509_ASN_ENCODING | PKCS_7_ASN_ENCODING,
    0,
    CERT_FIND_SUBJECT_STR,
    (LPVOID) szCertName, //Subject string in the certificate.
    NULL );
    if( pCertContext )
    WinHttpSetOption( m_hRequest,
    WINHTTP_OPTION_CLIENT_CERT_CONTEXT,
    (LPVOID) pCertContext,
    sizeof(CERT_CONTEXT) );
    CertFreeCertificateContext( pCertContext );
    CertCloseStore( hMyStore, 0 );
    // NOTE: Application should now resend the request.
    bResult = WinHttpSendRequest(m_hRequest, WINHTTP_NO_ADDITIONAL_HEADERS,0,WINHTTP_NO_REQUEST_DATA,0,0,0);
    if (!bResult) {
    printf("WinHttpSendRequest:Error %d has occurred.",GetLastError());
    return 0;
    DWORD dwStatusCode = 0;
    DWORD dwSize = sizeof(DWORD);
    BOOL bResults = true;
    bResults = WinHttpQueryHeaders( m_hRequest, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, NULL, &dwStatusCode, &dwSize, NULL );
    Result: I am getting status code of 404. I am not able to figure out why it is happening.
    FYI, Using `WinINet`,  I have followed the same procedure, I am getting status code of 200, which is success. But my requirement is to use only `WinHttp`.
    Could any one please help me out to solve this issue. This is very urgent for me.
    SivaV

    Dear Henri,
    Thanks for your reply, it was really very helpful.
    I debugged
    HTTP session with Fiddler,
    I am getting certificate error.
    When I say 'Yes' in Fiddler, I am getting 200 success.
    Could you please help me out how to
    "Ignore certificate errors" using WinHTTP
    API's.
    Thanks in Advance.
    Best Regards,
    Siva
    SivaV

  • Returning HTTP status codes (401, 403, etc) to Flash 8

    Hi all,
    I'm using AMFPHP on the server-side and Flash remoting
    classes to communicate with it. Everything's working great, but i'd
    like Flash to be able to recieve HTTP status codes from the server.
    For example, if on the server side (in PHP) I go:
    header("Status: 401 Unauthorized");
    I'd like the remoting service on the flash side to be able to
    get the HTTP error code (401 in the example above).
    I know this is possible with
    [url=http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context =LiveDocs_Parts&file=00002333.html]LoadVars.onHTTPStatus[/url]
    but it doesn't seem to deal with using it with Flash Remoting.
    Thanks all :)
    - Nilesh

    Hi, I am trying to PUT to update contact info and I get following error:
    2015-01-16 11:00:17,970 INFO [main] oracle.eloqua.connector.eloqua.EloquaConnector.putWithBasicAuth(97) | accessHttpsPut.url=https://secure.eloqua.com/API/REST/2.0//data/contact/7606838, text={"id":"7606838","accountName":"openIdStr001","emailAddress":"[email protected]","type":"Contact"}
    2015-01-16 11:00:18,931 ERROR [main] oracle.eloqua.connector.eloqua.EloquaConnector.putWithBasicAuth(140) | ClientProtocolException
    org.apache.http.client.HttpResponseException: Request is malformed.
    Is there any idea?
    Thanks so much.
    Sincerely.

  • Setting 2xx Status Code in Message Container

    Hello all,
    is there any possibility to set an HTTP Status code in a message container(/iwbep/if_message_container)? Or to set it in the http response?
    Regards

    Hello,
    Let me correct myself in earlier response. I was saying that it is possible to set messages in response header. As per my understanding, you cannot set http status code such as 2XX etc. it will be setup by GW framework.
    you can pass back messages as discussed in the thread OR can place S, I, W messages in an SAP header SAP-Message.
    Regards,
    Chandra

  • Setting response HTTP status code

    Hi all,
    it's possible to set a response HTTP 202 status code for Axis?
    Thanks Pasquy.

    Not sure if you're aware of this, but the status codes that must/should be used are specified in the SOAP HTTP binding spec and the Basic Profile.
    See http://www.ws-i.org/Profiles/BasicProfile-1.0-2004-04-16.html (see, e.g., s4.3.6), and the SOAP spec.
    That said, apparently 202 is acceptable in some circumstances, and I'm not sure on how to set the response code with Axis.
    -Tim

  • Error code: InternalError, Http status code: 500 while testing an experiment

    Creating a very simple experiment with just a Dataset, followed by a simple regresion using an Execute
    R Task , I get an internal server error while testing the published experiment
    Hitting run everything goes smooth and I can see all data,but when i hit 'test' from the web services dashboard
    right after publishing,I get this:
    Error code: InternalError, Http status code: 500, Request id: d87e2d01-16ef-4ac9-8a5d-a58d41aab2d4, Timestamp: Tue,
    03 Mar 2015 12:19:55 GMT
    How can I handle this ?
    Thank you in advance.

    Hi Shreyas!
    Are you familiar with the tryCatch() function in R? in your error condition, you can return the error message a bit more cleanly as shown in the following code snippet. FYI one common error we see is R scripts that are not able to handle a single-row input
    or with mismatched data types.
    tryCatch({
    # Do what you want in here
    maml.mapOutputPort("data.set");
    }, error = function(e) {
    data.set = data.frame(errormsg = conditionMessage(e))
    print(conditionMessage(e));
    maml.mapOutputPort("data.set");

  • WLS 8.1 Apache Plug-in is changing HTTP status code 999 to 500

    I'm seeing the weblogic server 8.1 sp4 apache plug-in change the HTTP status code of 999 (set by the application) to 500 Internal Server Error. I'm seeing this with Apache 2.0.48 on aix and with Apache 2.0.58 on windows. I've tried the plug-in from 8.1 SP2, SP4 and SP6 with all yielding the same result. I've tried the SSL plug-in too - same result. I'm told by the maker of this application that they are not seeing this issue with the plug-in for SunOne/NES. What does BEA say about the Apache plug-in changing the http status code? Why is it doing this? Why doesn't the SunOne/NES plug-in do it? Can you provide a plug-in that does not do this?

    Try setting
    Debug ALL
    inside your IfModule. All proxy activity will be written to /tmp/wlproxy.log (on
    unixes). If no info appears in the log, Apache is not invoking the plug-in properly.
    HTH
    "Lukas" <[email protected]> wrote:
    >
    I am trying to set up Apache 2.0.49 proxy plug-in for my WLS 8.1 cluster
    (2 managed
    servers). I followed instructions at http://edocs.bea.com/wls/docs81/plugins/apache.html.
    My test web application runs on
    192.168.10.142:5001/public/testwebapp
    and
    192.168.10.142:6001/public/testwebapp
    I have tested my cluster using another instance on WLS and HttpClusterServlet
    and it works fine.
    I have added following section to my httpd.conf
    LoadModule weblogic_module modules/mod_wl_20.so
    <IfModule mod_weblogic.c>
    WebLogicCluster 192.168.10.142:6001,192.168.10.142:5001
    </IfModule>
    <Location /public/testwebapp>
    SetHandler weblogic-handler
    PathTrim /public/testwebapp
    ErrorPage http://myerrorpage1.mydomain.com
    </Location>
    I restarted my wls cluster and apache as well and when I specify http://192.168.10.142/public/testwebapp
    (apache web server) I receive Error 404--Not Found (even thou I have
    tested my
    http://192.168.10.142:5001/public/testwebapp and http://192.168.10.142:6001/public/testwebapp
    - they work correctly).
    There is nothing in apache’s error_log file.
    There is a record in access_log file reading:
    192.168.10.126 - - [08/Jun/2004:16:23:32 -0700] "GET /public/testwebapp
    HTTP/1.1"
    404 1214
    which gives me an impression that “proxy” – forwarding does not work.
    Where should I look for some errors?
    Thanks,
    Lukas

  • How to set 'error' status with DB poll Adapter in OSB

    1. Configured DB Adapter to poll rows with status 'notprocessed' and set the status to 'processed'
    2. Configured FTP Adapter to write fetched rows from DB into a CSV file
    Now my requirement is if any error like FTP server is not available, how to set the status in DB table to 'error'

    Yes Vlad you are right, this will avoid another DB connection created in Error Handler.
    I hope this will provide some lights on the usefulness of "Transaction"
    http://www.nysolutionsltd.com/transaction-handling-in-oracle-service-bus/
    http://kd-blog-tech.blogspot.com.au/2010/12/transaction-management-for-osb-service.html
    Regards
    RK
    Edited by: RK.. on 27/03/2013 17:10

  • HTTP status code returned by site-wide error handler is 200 OK?

    I'm using a developer install of ColdFusion 11. I set up the following page at http://localhost:8500/test/index.cfm:
    <cfthrow type="application" message="This is an error">
    When I visit that page, the HTTP status code returned is 500, as expected.
    I then created the following page at http://localhost:8500/error.cfm:
    <p>Sorry! That was an error.</p>
    If I set the site-wide error handler in the CF Admin to /error.cfm and visit /test/index.cfm, the HTTP status code returned is 200 OK.
    This seems weird to me. It looks like I can include the following in the error.cfm file to send an error code instead:
    <cfheader statuscode="500" statustext="Server Error">
    Does anyone see that as problematic? Is there a reason why the site-wide error handler should return 200 OK?

    Error Codes are the responsibility of the developer, to define and broadcast. Ultimately, the ColdFusion server has acted appropriately and fulfilled the request (hence the 202). Only the code would know what error was truly thrown, and how to appropriately handle that message to the user, hence the need for you to change the header in the response, if you want that broadcast to the browser in anything of than a "successful request" type of status.

  • TREX preprocessing failed, HTTP Status Code 401

    Hello everybody!
    I'm using SAP NetWeaver 7.0 (2004s), TREX 7.0 on Win2003 Server.
    I'm trying to index files, but it doesn't work for files bigger than 10KB. I know that for these documents > 10KB only the URI is transmitted to TREX. So it seems the problem is based on the communication between TREX and portal.
    Error messages:
    TREX monitor: preprocessing failed, error number: 6401, error message: HTTP Status Code 401: Unauthorized
    Indexmonitor: Trex: Preparation failed: index operation
    - all TREX server status icons are green.
    - I'm not using any SSL communication.
    - indexing doesn't work for any data sources, neither web repositories nor KM content.
    - I've checked the host and alternative host parameter in the URL generator service (both http://<myservername>:50100).
    - I am able to access the URL of the resource directly.
    - I've added the "unescape_url=no" entry in the TREXPreprocessor.ini like SAP Note 650521 says.
    - my system ID is properly set.
    - the password of user index_service does not expire.
    Does anybody have any further ideas?
    Many thanks in advance
    Steffi, working on it for days...

    Hello Robert and Steffi,
    With the help of SAP support, I could solve the problem !
    Certificate for SAPLogonTickets had expired, so authentication was no longer possible. Solution : recreated the certificates with Visual Admin.
    In Visual Admin, go to "Key Storage" service, then choose "TicketKeystore" view.
    Delete SAPLogonTicketKeypair and SAPLogonTicketKeypair-cert certificates (or rename them in a first time).
    Then recreate "SAPLogonTicketKeypair" :
    - fill the Entry Name with "SAPLogonTicketKeypair",
    - fill "Common Name" with the value from the previous ticket
    - check "Store Certificate" (this will automatically create SAPLogonTicketKeypair-cert)
    - choose "DSA" as Algorithm
    and click on "Generate"
    That worked fine for us on two platforms.
    Hope that gonna help...
    Nicolas

  • How to set custmer master block for posting & how to set the status .....

    < MODERATOR:  Message locked.  Please read the [Rules of Engagement|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement] before posting next time. Use an appropriate subject in your message thread. >
    Hi ...
    How to set custmer master blocked for posting & how to set the status has deleted. please provide the steps for the above two actions.
    thanks

    Hi,
    U can use T-code FD05 for Blocking the customer and
    T-code FD06 in order to set for deletion,
    Assign Points if useful,
    Regards,

  • Http status code

    Hi,
    I have a problem i tried a lot i not able find a solution for this can u please help me in resolving this.
    i have a html page in that i am uploading a file. i am sending the data in a post request. after that it will go to the servlet and there it will savethe file in the server. from there i nee to get the http status code. how can i do that. ( i am submiting the form from javascript).
    plz plz help me guys..........
    thanks in advance

    The web server should send a response to the client. The browser will display an error message if the response code is not "200 OK" such as "404 File Not Found" and so on.

  • [Exchange-Online][EWS-XML][JAVA][OAUTH2] Getting HTTP status code 500 when using OAUTH2 client credential grant flow as authorization method

    Hi,
    i'm working on enhancing a service to be able to use OAUTH2 as authentication protocol with client credential grant flow when talking to exchange online ( like described here:
    http://blogs.msdn.com/b/exchangedev/archive/2015/01/22/building-demon-or-service-apps-with-office-365-mail-calendar-and-contacts-apis-oauth2-client-credential-flow.aspx ). I gave my application the rights 
    Office 365 Exchange Online : Application Permissions: "Have full access via EWS to all mailboxes ....."
    Windows Azure Active AD: Application Permissions: "Read Directory data", Delegate Permissions: "Enable sign-on and read users_ profiles" 
    I receive a access token from log.windows.net:
    decoded token:
     typ: "JWT",
     alg: "RS256",
     x5t: "MnC_VZcATfM5pOYiJHMba9goEKY"
     aud: "https://outlook.office365.com/",
     iss: "https://sts.windows.net/<TENANT_ID>/",
     iat: 1426584502,
     nbf: 1426584502,
     exp: 1426588402,
     ver: "1.0",
     tid: "<TENANT_ID>",
     roles: [
      "full_access_as_app"
     oid: "1ddbdc11-b80d-4d1d-91b9-5b07a6b82659",
     sub: "1ddbdc11-b80d-4d1d-91b9-5b07a6b82659",
     idp: "https://sts.windows.net/TENANT_ID/",
     appid: "<APP_ID_IN_AZURE_AD>",
     appidacr: "2"
    <SIGNATURE>
    If i use that token then to send a EWS XML to exchange online i get a 500 HTTP status code back:
    With impersonation in the request:
    [http.wire ]: >> "POST /EWS/Exchange.asmx HTTP/1.1[\r][\n]"
    [http.wire ]: >> "Authorization: Bearer <MY_ACCESS_TOKEN>[\r][\n]"
    [http.wire ]: >> "SoapAction: "http://schemas.microsoft.com/exchange/services/2006/messages/GetFolder"[\r][\n]"
    [http.wire ]: >> "Content-Type: text/xml; charset=utf-8[\r][\n]"
    [http.wire ]: >> "User-Agent: OpenScapeUC EWS HttpClient/3.0[\r][\n]"
    [http.wire ]: >> "client-request-id: 5b2c7e1a-656d-4f43-bd34-ea2d6290611f[\r][\n]"
    [http.wire ]: >> "Date: Tue, 17 Mar 2015 10:08:17 GMT[\r][\n]"
    [http.wire ]: >> "Content-Length: 1189[\r][\n]"
    [http.wire ]: >> "Host: outlook.office365.com[\r][\n]"
    [http.wire ]: >> "Connection: Keep-Alive[\r][\n]"
    [http.wire ]: >> "[\r][\n]"
    [http.wire ]: >> "<?xml version="1.0" ?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Header><ns2:ExchangeImpersonation xmlns:ns2="http://schemas.microsoft.com/exchange/services/2006/types"
    xmlns:ns3="http://schemas.microsoft.com/exchange/services/2006/messages"><ns2:ConnectingSID><ns2:PrimarySmtpAddress><THE_MAILBOX_I_WANT_TO_ACCESS></ns2:PrimarySmtpAddress></ns2:ConnectingSID></ns2:ExchangeImpersonation><ns2:RequestServerVersion
    xmlns:ns2="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ns3="http://schemas.microsoft.com/exchange/services/2006/messages" Version="Exchange2007_SP1"/></S:Header><S:Body><ns3:GetFolder xmlns:ns2="http://schemas.microsoft.com/exchange/services/2006/types"
    xmlns:ns3="http://schemas.microsoft.com/exchange/services/2006/messages"><ns3:FolderShape><ns2:BaseShape>IdOnly</ns2:BaseShape><ns2:AdditionalProperties><ns2:FieldURI FieldURI="folder:FolderId"/></ns2:AdditionalProperties></ns3:FolderShape><ns3:FolderIds><ns2:DistinguishedFolderId
    Id="contacts"><ns2:Mailbox><ns2:EmailAddress><THE_MAILBOX_I_WANT_TO_ACCESS></ns2:EmailAddress></ns2:Mailbox></ns2:DistinguishedFolderId></ns3:FolderIds></ns3:GetFolder></S:Body></S:Envelope>"
    [http.wire ]: << "HTTP/1.1 500 Internal Server Error[\r][\n]"
    [http.wire ]: << "Cache-Control: private[\r][\n]"
    [http.wire ]: << "Content-Type: text/xml; charset=utf-8[\r][\n]"
    [http.wire ]: << "Server: Microsoft-IIS/8.0[\r][\n]"
    [http.wire ]: << "request-id: ec42b5c5-f8dc-498d-ae16-d851a852058c[\r][\n]"
    [http.wire ]: << "Set-Cookie: ClientId=<DELETED>; expires=Wed, 16-Mar-2016 10:08:17 GMT; path=/; secure; HttpOnly[\r][\n]"
    [http.wire ]: << "X-CalculatedBETarget: am2pr02mb0387.eurprd02.prod.outlook.com[\r][\n]"
    [http.wire ]: << "X-DiagInfo: AM2PR02MB0387[\r][\n]"
    [http.wire ]: << "X-BEServer: AM2PR02MB0387[\r][\n]"
    [http.wire ]: << "X-AspNet-Version: 4.0.30319[\r][\n]"
    [http.wire ]: << "Set-Cookie: exchangecookie=<DELETED>; expires=Thu, 17-Mar-2016 10:08:17 GMT; path=/; HttpOnly[\r][\n]"
    [http.wire ]: << "Set-Cookie: [email protected]=<DELETED>; expires=Thu, 16-Apr-2015 10:08:18 GMT; path=/EWS; secure; HttpOnly[\r][\n]"
    [http.wire ]: << "Set-Cookie: [email protected]=<DELETED>; expires=Thu, 16-Apr-2015 10:08:18 GMT; path=/EWS; secure; HttpOnly[\r][\n]"
    [http.wire ]: << "X-Powered-By: ASP.NET[\r][\n]"
    [http.wire ]: << "X-FEServer: DB5PR01CA0064[\r][\n]"
    [http.wire ]: << "Date: Tue, 17 Mar 2015 10:08:17 GMT[\r][\n]"
    [http.wire ]: << "Content-Length: 891[\r][\n]"
    [http.wire ]: << "Accept-Ranges: none[\r][\n]"
    [http.wire ]: << "Connection: keep-alive[\r][\n]"
    [http.wire ]: << "[\r][\n]"
    Without impersonation in the request:
    Request
    [http.wire ]: >> "POST /EWS/Exchange.asmx HTTP/1.1[\r][\n]"
    [http.wire ]: >> "Authorization: Bearer <MY_ACCESS_TOKEN>[\r][\n]"
    [http.wire ]: >> "SoapAction: "http://schemas.microsoft.com/exchange/services/2006/messages/GetFolder"[\r][\n]"
    [http.wire ]: >> "Content-Type: text/xml; charset=utf-8[\r][\n]"
    [http.wire ]: >> "User-Agent: OpenScapeUC EWS HttpClient/3.0[\r][\n]"
    [http.wire ]: >> "client-request-id: 20bd722f-8276-4ebb-8d58-ce45d31f3ed4[\r][\n]"
    [http.wire ]: >> "Date: Tue, 17 Mar 2015 09:33:24 GMT[\r][\n]"
    [http.wire ]: >> "Content-Length: 871[\r][\n]"
    [http.wire ]: >> "Host: outlook.office365.com[\r][\n]"
    [http.wire ]: >> "Connection: Keep-Alive[\r][\n]"
    [http.wire ]: >> "[\r][\n]"
    [http.wire ]: >> "<?xml version="1.0" ?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Header><ns2:RequestServerVersion xmlns:ns2="http://schemas.microsoft.com/exchange/services/2006/types"
    xmlns:ns3="http://schemas.microsoft.com/exchange/services/2006/messages" Version="Exchange2007_SP1"/></S:Header><S:Body><ns3:GetFolder xmlns:ns2="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ns3="http://schemas.microsoft.com/exchange/services/2006/messages"><ns3:FolderShape><ns2:BaseShape>IdOnly</ns2:BaseShape><ns2:AdditionalProperties><ns2:FieldURI
    FieldURI="folder:FolderId"/></ns2:AdditionalProperties></ns3:FolderShape><ns3:FolderIds><ns2:DistinguishedFolderId Id="contacts"><ns2:Mailbox><ns2:EmailAddress><THE_MAILBOX_I_WANT_TO_ACCESS></ns2:EmailAddress></ns2:Mailbox></ns2:DistinguishedFolderId></ns3:FolderIds></ns3:GetFolder></S:Body></S:Envelope>"
    Response:
    [http.wire ]: << "HTTP/1.1 500 Internal Server Error[\r][\n]"
    [http.wire ]: << "Cache-Control: private[\r][\n]"
    [http.wire ]: << "Content-Type: text/xml; charset=utf-8[\r][\n]"
    [http.wire ]: << "Server: Microsoft-IIS/8.0[\r][\n]"
    [http.wire ]: << "request-id: 923ba463-490f-4ac9-a496-993cd8a44115[\r][\n]"
    [http.wire ]: << "Set-Cookie: ClientId=<DELETED>; expires=Wed, 16-Mar-2016 09:33:24 GMT; path=/; secure; HttpOnly[\r][\n]"
    [http.wire ]: << "X-CalculatedBETarget: am2pr02mb0387.eurprd02.prod.outlook.com[\r][\n]"
    [http.wire ]: << "X-DiagInfo: AM2PR02MB0387[\r][\n]"
    [http.wire ]: << "X-BEServer: AM2PR02MB0387[\r][\n]"
    [http.wire ]: << "X-AspNet-Version: 4.0.30319[\r][\n]"
    [http.wire ]: << "Set-Cookie: exchangecookie=<DELETED>; expires=Thu, 17-Mar-2016 09:33:25 GMT; path=/; HttpOnly[\r][\n]"
    [http.wire ]: << "Set-Cookie: [email protected]=<DELETED>; expires=Thu, 16-Apr-2015 09:33:25 GMT; path=/EWS; secure; HttpOnly[\r][\n]"
    [http.wire ]: << "Set-Cookie: [email protected]=<DELETED>; expires=Thu, 16-Apr-2015 09:33:25 GMT; path=/EWS; secure; HttpOnly[\r][\n]"
    [http.wire ]: << "X-Powered-By: ASP.NET[\r][\n]"
    [http.wire ]: << "X-FEServer: AM3PR07CA0038[\r][\n]"
    [http.wire ]: << "Date: Tue, 17 Mar 2015 09:33:24 GMT[\r][\n]"
    [http.wire ]: << "Content-Length: 799[\r][\n]"
    [http.wire ]: << "Accept-Ranges: none[\r][\n]"
    [http.wire ]: << "Connection: keep-alive[\r][\n]"
    If i use BASIC authentication and impersonation the request is successfully. 
    Has anyone an idea why i might get the error 500 in that scenario?

    For EWS to work with App Token, you need to do two more things. One you already did: Set the impersonation header. Two is to set the X-AnchorMailbox http request header to the smtp address of the mailbox you want to access. This routes the request instantly
    to the right backend.
    Hope this helps.
    Thank you! Matthias

Maybe you are looking for

  • Creative Zen sleek, folder based explori

    Ok, long story short. i upgraded my Zen sleeks firmware, and for my disapoint, i founded out that whit the new firmware i cant use the "Creative media explorer", and im "forced" to use ether the crappy Mediaplayer 0, or the the "drag and drop" functi

  • Why can't I start my MacBook 5,2 in 64-bit mode?

    I've checked: The processor is of x86_64 architecture (Core 2 Duo, 2.13Ghz). I've tried holding 6 and 4 while booting. I've tried the command line route. I've tried Startup Mode Selector. Nothing works. In fact, Startup Mode Selector says that, while

  • Logic suddenly quits unexpectedly on startup

    I haven't used Logic for a week or so, and now Logic quits unexpectedly on startup. Any ideas? I'm on 7.2 and 10.4.6. When Logic boots I get past all the initial loading and even get the arrange page to display (so nothing wrong with AU's or midi and

  • 7.2 upgrade

    I downloaded the 7.2 upgrade when prompted and now am unable to play any purchased music on my iPod. What is the easiest way to fix the problem? I'm not a computer whiz. Just liked the iPod when it was easy to use.

  • I want to updatemy iphone 3gs from 4.1 to 6.1, i want to updatemy iphone 3gs from 4.1 to 6.1

    i want to updatemy iphone 3gs from 4.1 to 6.1, i want to updatemy iphone 3gs from 4.1 to 6.1