Exchange Webservice integrated to 2.0 website. Giving problem after it is Published but working fine in development system.


  • Environment Description:
             Development will proceed in one system. After testing the same will be published to the other server. The process of publishing I follow like chosing "Publish Web Site" from the "Build" menu to the local folder. After it is successfully published, I will copy the entire folder contents to the folder located in the Server. That folder in server is configured as website on the new other port number.

          Development System
                Windows XP
                IIS 7.0
                Port: 1800

                This website references to folder which contains all aspx and aspx.vb and aspx.cs files

          Publishing Server
             Server: Windows 2003 Server
             IIS version: 6.0
             Port: 2700

             This website references to folder which contains the published files of development system.

    Process how I am integrating Exchange Service:

    Recently my organisation installed Exchange Server 2007 in another server say IP is

    I am integrating the Exchange through webservice to the existing website. The process I followed is - 

    I have successfully added web reference: 
    Then it was asking for authentication.
              I have give the administrator privileges. Here there are two administrators one is built in administrator for DC same as published server and the other administrator is "exchadmin" only for exchange server. I tried with both the privileges.

              Then I have developed a webpage to send a mail. I am testing on the testing system with the following link.


              I am able to send the mail perfectly without any problem.

              Now, my next phase is to publish the total website to the local folder and copy the total contents of the local folder to the server. I have done the same thing which is successful.

             Problem is now I am unable to send the mail. Url which I am using is:


             Error I am getting is:

    The request failed with HTTP status 401: Unauthorized.
    System.Net.WebException: The request failed with HTTP status 401: Unauthorized. at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at com.janapriya.webmail.ExchangeServiceBinding.CreateItem(CreateItemType CreateItem1) at jpSendMailExchange.butSendViaExchange_Click(Object sender, EventArgs e)

    I have tried to solve this problem myself but this time it seems a little bit critical and beyond my imaginations.

    Methods I have attempted:
              It is not a virtual site but a website on different port number. I tried your suggestions but sorry to say there is no change in the error.

              I have given DC administrator credentials to the application pool, then the website is working but exchange problem remains same.

              Then I have given exchange administrator credentials to the application pool, then the website itself is not working. Message is "Server Not Available"

              I discussed this issue with my system administrator and given all the priveleges of exchange administrator to the DC administrator and again supplied the DC administrator credentials but this time website running properly but the exchange problem remains same.

    Please somebody suggest me how to solve this problem

    Thanks & Regards

    I am a small programmer
    • Edited by cynosingh Friday, July 10, 2009 5:45 AM For formatting only
    Friday, July 10, 2009 5:37 AM

All replies