Silverlight - Exchange EWS RRS feed

  • Question

  • Hi,

    I read that it is possible to connect to Exchange EWS from Silverlight application. (

    But i have problem with it.

    I created web reference to the service. Sample code:

    BasicHttpBinding binding = new BasicHttpBinding(BasicHttpSecurityMode.TransportWithMessageCredential);
    binding.MaxReceivedMessageSize = int.MaxValue;
    EndpointAddress address = new EndpointAddress(new Uri(""));
    ExchangeService.ExchangeServicePortTypeClient proxy = new ExchangeServicePortTypeClient(binding, address);
    proxy.ClientCredentials.UserName.UserName = "user";
    proxy.ClientCredentials.UserName.Password = "password";
    GetUserAvailabilityRequestType art = new GetUserAvailabilityRequestType();
    /*... some code populating request...*/
    proxy.GetUserAvailabilityCompleted += new EventHandler<GetUserAvailabilityCompletedEventArgs>(completedEvent);



    <?xml version="1.0" encoding="utf-8"?>
          <allow-from http-request-headers="*">
            <domain uri="*"/>
            <resource path="*" include-subpaths="true"/>


    And I get:

    System.ServiceModel.CommunicationException: An error occurred while trying to make a request to URI ''. This could be due to attempting to access a service in a cross-domain way without a proper cross-domain policy in place, or a policy that is unsuitable for SOAP services. You may need to contact the owner of the service to publish a cross-domain policy file and to ensure it allows SOAP-related HTTP headers to be sent. This error may also be caused by using internal types in the web service proxy without using the InternalsVisibleToAttribute attribute. Please see the inner exception for more details. ---> System.Security.SecurityException ---> System.Security.SecurityException: Security error.
       w System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)


    Can anybody help me solve this problem?

    Friday, April 1, 2011 10:43 AM

All replies