Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3847784
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T16:36:15+00:00 2026-05-19T16:36:15+00:00

I am trying to get EWS’s push notifications set up in my c# app.

  • 0

I am trying to get EWS’s push notifications set up in my c# app.

After getting the response from the server and reading it using a NetworkStream I need to respond to the server with Ok in a SOAP message. The only example that I can find uses Microsoft.Web.Services3 and a SoapEnvelope. My understanding is that this has now been replaced by WCF and I really want to use the newer technologies (to learn them).

How would I go by sending a SOAP message back to the server, presumably using the same NetworkStream that I get the notification on?

Here is some code that I tried, but it fails for some reason.

const string RESPONSE_OK = "<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope\"><soap:Body>" +
                "<SendNotificationResult xmlns=\"http://schemas.microsoft.com/exchange/services/2006/messages\">" +
                "<SubscriptionStatus>OK</SubscriptionStatus></SendNotificationResult></soap:Body></soap:Envelope>";

responseBytes = encoding.GetBytes(RESPONSE_OK);

             // Send the result
             HTTPResponseStruct _httpResponse;
            _httpResponse.version = "HTTP/1.1";
            _httpResponse.BodyData = responseBytes;

            _httpResponse.Headers = new Hashtable();
            _httpResponse.Headers.Add("Server", "IT12");
            _httpResponse.Headers.Add("Date", DateTime.Now.ToString("r"));
            _httpResponse.Headers.Add("Content-Type", "text/xml; charset=utf-8");
            _httpResponse.Headers.Add("Content-Length", _httpResponse.BodyData.Length);
            _httpResponse.Headers.Add("Connection", "close");


            string HeadersString = _httpResponse.version + " "
               + "200 OK" + "\r\n";

            foreach (DictionaryEntry Header in _httpResponse.Headers)
            {
                HeadersString += Header.Key + ": " + Header.Value + "\r\n";
            }

            HeadersString += "\r\n";

            byte[] bHeadersString = Encoding.ASCII.GetBytes(HeadersString);

            // Send headers   
            clientStream.Write(bHeadersString, 0, bHeadersString.Length);


            // Send body
            if (_httpResponse.BodyData != null)
                clientStream.Write(_httpResponse.BodyData, 0,
                         _httpResponse.BodyData.Length);
           // clientStream.Write(responseBytes, 0, responseBytes.Length);
            clientStream.Flush();

Thanks,
Pieter

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T16:36:16+00:00Added an answer on May 19, 2026 at 4:36 pm

    you can use Microsoft.Exchange.WebServices.Data (EWS Managed API Reference)

    http://msdn.microsoft.com/en-us/library/dd633710%28v=EXCHG.80%29.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying get values from a GridView using the following code: foreach (GridViewRow row
Trying to get parameters from a PUT request using HttpServlet#doPut: public void doPut(HttpServletRequest request,
Hi am trying get GPS using network provider and GPS provider. but am getting
I am trying get content from the link https://....com:8455 where Server's certificate is not
I'm trying get bytes from bitmap in blackberry using the next method in Bitmap:
in my app i am trying to get an xml file from an URL.
I am trying get the data from my database but i am not getting
Trying to get this example working from http://www.munna.shatkotha.com/blog/post/2008/10/26/Light-box-effect-with-WPF.aspx However, I can't seem to get
When I'm trying get method from remote webservice it gives me error. My code
When trying get in memcache client, getting the below excepton. Caused by: java.io.IOException: com.fet.myclass.webservice.data.DataList

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.