none
error: attempting to access a service in a cross-domain way without a proper cross-domain policy in place

    Question

  • An error occurred while trying to make a request to URI 'http://localhost:4846/Service1.svc'. This could be due to 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.

    Here is the VS08 Dev Environment giving some context to the location of the code where the exception was thrown;

    http://1.bp.blogspot.com/_CQoTPxzuRCQ/SWKWZFKcs7I/AAAAAAAAAWQ/n64NrBV5m8s/s1600-h/attempting+to+access+a+service+in+a+cross-domain+way.jpg

     and the entire error is at the top of my blog under Silverlight DataGrid Theming.  http://greghazzard.blogspot.com/

    None of the possible solutions that have worked for others have helped me thus far in solving this cross-domain issue. I am using Visual Studio 2008 Development Server and not IIS,  If for some reason my exercise with getting the new Dec 2008 Silverlighgt DataGrid and recommended workaround to get Silverlight SDK Themes to work with the DataGrid has introduced a 'wrinkle' into the mix, then I will gladly move to IIS if there is reason to. For obvious debugging reasons I hope to remain in VS08.

    1. setting the binding to basicHttpBindingin the web.config.

      <client>
       <endpoint address="http://localhost:4846/Service1.svc" binding="basicHttpBinding"
        bindingConfiguration="BasicHttpBinding_Service1" contract="ServiceReference1.Service1"
        name="BasicHttpBinding_Service1" />
      </client>
       <service behaviorConfiguration="XTO_Silverlight_WCF_CurrentSummary.Web.Service1Behavior"
        name="XTO_Silverlight_WCF_CurrentSummary.Web.Service1">
        <endpoint address="" binding="basicHttpBinding" contract="XTO_Silverlight_WCF_CurrentSummary.Web.Service1" />
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
       </service>

     2.  My app began without either clientaccesspolicy.xml or crossdomain.xml. Do I now require one? Here is a discussion about deleting one of them should I have had that problem. Without either one present, that is clearly not causing my current error exception.         http://silverlight.net/forums/t/61381.aspx

    3. selecting a specific port address (3012 in my case) under Web properties in the Project settings.

     ServiceReferences.ClientConfig

    <configuration>
        <system.serviceModel>
            <bindings>
                <basicHttpBinding>
                    <binding name="BasicHttpBinding_Service1" maxBufferSize="2147483647"
                        maxReceivedMessageSize="2147483647">
                        <security mode="None" />
                    </binding>
                </basicHttpBinding>
            </bindings>
            <client>
                <endpoint address="http://localhost:4846/Service1.svc" binding="basicHttpBinding"
                    bindingConfiguration="BasicHttpBinding_Service1" contract="ServiceReference1.Service1"
                    name="BasicHttpBinding_Service1" />
            </client>
        </system.serviceModel>
    </configuration>
    http://1.bp.blogspot.com/_CQoTPxzuRCQ/SWKfOwIp48I/AAAAAAAAAWY/_5eODhA2lVM/s1600-h/specific+port+used+in+cross+domain+error.jpg

     any other ideas anyone? 

    With appreciation,

    Greg Hazzard

     

    Monday, January 05, 2009 2:49 PM

Answers

  • Yes an access policy file is required.  Sometimes your project may work without it locally(I'm not sure why), but more often than not it's just better to have it.

    Monday, January 05, 2009 7:57 PM

All replies

  • Yes an access policy file is required.  Sometimes your project may work without it locally(I'm not sure why), but more often than not it's just better to have it.

    Monday, January 05, 2009 7:57 PM
  • crossdomain.xml, where have you been all my life! Thank you for steering me in the right direction John. -hazz

    <?xml version="1.0"?>

    <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">

    <cross-domain-policy> <allow-http-request-headers-from domain="*" headers="*"/>

    </cross-domain-policy>

    Tuesday, January 06, 2009 12:41 AM
  •  Hey there, I'm having similar problems trying to access a remote web service that I have developed and published, but I already have the client access policy and cross domain xml files in the root directory of the web site.

     Using an HTTP snooper I can see that whichever of the files I try to use (I'm trying both of the domain policy file types supported) they are successfully retrieved (200 Status error, without any corruption of the document) and yet I still get this error thrown by Silverlight (I've replaced the domain & folder):

     An error occurred while trying to make a request to URI 'https://domain/folder/BW_ClientGeneral.svc'. 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. Please see the inner exception for more details.

      Here is the clientaccesspolicy.xml contents:

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

    And the crossdomain.xml :

    <?xml version="1.0"?>
    <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
    <cross-domain-policy>
    <allow-http-request-headers-from domain="*" headers="*"/>
    </cross-domain-policy>

     So it seems from my snooper that silverlight IS RECEIVING the policy files, but is still throwing the security exception.

     I guess I could be assuming that it is the policy, but it seems most likely.  I have tested access to the policies over HTTP & HTTPS and can see no problem, but that is to be expected given silverlight seems to be downloading them.  The webservice has been tested and deployed, but this is my first attempt to utilise it since deployment - could there be something in the web.config of the application serving the service?

    Can anyone see anything I am missing that might help?

    Thursday, January 15, 2009 5:07 PM
  • I have both the files on the right place in my project directory still I am getting the same error as mentioned about screen shot Can anyone please help me out.  

    clientaccesspolicy.xml <?xml version="1.0" encoding="utf-8"?><access-policy><cross-domain-access><policy>      <allow-from http-request-headers="*">        <domain uri="http://localhost:1881/Service1.svc"/>      </allow-from>      <grant-to>        <resource path="/" include-subpaths="true"/>      </grant-to>    </policy>  </cross-domain-access></access-policy>crossdomain.xml<?xml version="1.0"?><!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd"> <cross-domain-policy>  <allow-http-request-headers-from domain="*" headers="*"/></cross-domain-policy>  

    Error Description :

    System.ServiceModel.CommunicationException was unhandled by user code
      Message="An error occurred while trying to make a request to URI 'http://localhost:1881/Service1.svc'. 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. Please see the inner exception for more

    details."
      StackTrace:
           at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)
           at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
           at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
           at System.ServiceModel.ClientBase`1.ChannelBase`1.EndInvoke(String methodName, Object[] args, IAsyncResult result)
           at SilverlightApplication1.ServiceReference1.Service1Client.Service1ClientChannel.EndGetCustomersByCity(IAsyncResult result)
           at SilverlightApplication1.ServiceReference1.Service1Client.ServiceReference1_IService1_EndGetCustomersByCity(IAsyncResult result)
           at SilverlightApplication1.ServiceReference1.Service1Client.OnEndGetCustomersByCity(IAsyncResult result)
           at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result)
      InnerException: System.Security.SecurityException
           Message=""
           StackTrace:
                at System.Net.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)
                at System.Net.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
                at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)
           InnerException: System.Security.SecurityException
                Message="Security error."
                StackTrace:
                     at System.Net.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
                     at System.Net.BrowserHttpWebRequest.<>c__DisplayClass5.<EndGetResponse>b__4(Object sendState)
                     at System.Net.AsyncHelper.<>c__DisplayClass2.<BeginOnUI>b__0(Object sendState)
                InnerException:  

     

    Friday, January 16, 2009 4:36 AM
  • Hi,

    Try removing the

    <identity>

    <dns value="localhost"/>

    </identity>

    Section from your web.config file.

     

    -Harish

    Friday, January 16, 2009 7:39 AM
  • I changed the localhost still I am geeting the same error. One more thing I want to let you know all that I am also getting error in service reference of datasourse file for  GenericObjectDataSource tag that is element is not declared.

    I am using Linq query (DataClasses1.dbml file) for connecting to database. resultant data I am binding data to datagrid using following code

    Private Sub btnQuery_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)

    Dim client As New ServiceReference1.Service1Client

    AddHandler client.GetCustomersByCityCompleted, AddressOf client_GetCustomersByCityCompleted

    client.GetCustomersByCityAsync(textBox.Text)

    End Sub

    Private Sub client_GetCustomersByCityCompleted( _

    ByVal sender As Object, _

    ByVal e As ServiceReference1.GetCustomersByCityCompletedEventArgs)

    dataGrid.ItemsSource = e.Result

    End Sub

    While running above code I am getting error in following function on bold line.

    Public Function EndGetCustomersByCity(ByVal result As System.IAsyncResult) As System.Collections.ObjectModel.ObservableCollection(Of ServiceReference1.Customer) Implements ServiceReference1.IService1.EndGetCustomersByCity

    Dim _args((0) - 1) As Object

    Dim _result As System.Collections.ObjectModel.ObservableCollection(Of ServiceReference1.Customer) = CType(MyBase.EndInvoke("GetCustomersByCity", _args, result),System.Collections.ObjectModel.ObservableCollection(Of ServiceReference1.Customer))

    Return _result

    End Function

     

    Friday, January 16, 2009 8:50 AM
  •  Have you guys figured out how to fix this yet. I am still stumped.

     I have added clientaccesspolicy.xml files to both my projects (service and client) and have added the crossdomain.xml file to my service.

    I am still getting the error on cross domain security error when I try to access the wcf which runs at localhost.

    Any ideas?

    Thursday, February 12, 2009 7:48 PM
  • I admit I don't have this issue dialed in but a couple of checklist items/thoughts "second set of eyes"

    do you have this clientaccesspolicy.xml in the root web directory? 

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

     as for crossdomain.xml as below, it doesn't, for me, seem to used in my current solution/project folder. I'm using the Default Web Server within VS08 at the moment.

    <?xml version="1.0"?>
    <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
    <cross-domain-policy>
      <allow-http-request-headers-from domain="*" headers="*"/>
    </cross-domain-policy>

    Thursday, February 12, 2009 8:32 PM
  • Try configuring the service reference and change the Collection type from System.Collections.ObjectModel.ObservableCollection to System.Collections.Generic.List

    Friday, February 13, 2009 9:51 AM
  • Hi Vaishalli,

    Try configuring the service reference and change the Collection type from System.Collections.ObjectModel.ObservableCollection to System.Collections.Generic.List

     Mokarom

     Please Mark as answer if this answers your query.
    Friday, February 13, 2009 9:55 AM
  • My code dies at:

    public System.Collections.ObjectModel.ObservableCollection<string> EndGetList(System.IAsyncResult result) {

    object[] _args = new object[0];

    System.Collections.ObjectModel.ObservableCollection<string> _result = ((System.Collections.ObjectModel.ObservableCollection<string>)(base.EndInvoke("GetList", _args, result)));return _result;

    }

    with the error

    An error occurred while trying to make a request to URI 'http://localhost:64972/PDSListService/Service.svc'. 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. Please see the inner exception for more details.

     

    and my namespace doesn't use observable in xaml.cs

     

    Friday, February 13, 2009 11:34 AM
  • Thanks so much to all my error get resolved.

    Vaishali

    Monday, February 16, 2009 2:05 AM
  •  

    Hi All, I hv tried with all above suggestions

    1) Tried applying both policy files.

    2) Tried Changing to generic.list

    3) Binding to basicHttpBinding

    Still getting the same problem, and got pisse dof this same error again and again.

    Can any one please tell me the exact solution?

    Monday, March 02, 2009 1:51 AM
  • If your using WCF, work with it in a single silverlight project.

     

    Monday, March 02, 2009 12:19 PM
  •  Ok I think I found what was causing me to have the same problem.  I noticed that the random port VS2008 was using today had changed from what it was last week.  I looked at my service refs and my web.config file and they were all using the old port number in the service definitions.  I deleted the service references and then recreated them and everything started working. - I then checked the web.config and service refs and they now have the new port number.

    This would go a long way to explain why a working prototype suddenly stopped working on code that had been well tested. - It also makes sense that the error was about cross domain problems.

     

    Strange that VS2008 doesn't catch this and make changes but.....

    Anyway, that is where I would look next if you are still having this problem. -  YMMV.  Hope it helps.

    Monday, March 02, 2009 7:05 PM
  • Thank you all.

    I was having the same problem with run time port selection, my port was getting changed.

    I made it ti fixed port from the property of the wcf services.

    And now its working fine.

    Cheers!!

    Tuesday, March 03, 2009 1:22 AM
  • same problem iam getting but cudn't figured it out y

    i hv taken silverlight application 

    i am using my webservice located @ client server (say http://192:...) and added thru add service ref

    i created a Virtual Directory in IIS

    and calling in page.xaml.cs file iam using the code

    dpWorkshop.WorkshopSoapClient oClient = new SilverlightApplication2.dpWorkshop.WorkshopSoapClient();oClient.GetWorkshopActivityCompleted += new EventHandler<SilverlightApplication2.dpWorkshopActivity.GetWorkshopActivityCompletedEventArgs>(oClient_GetWorkshopActivityCompleted);

    oClient.GetWorkshopActivityAsync(570);

     

    some thing like that and when i run it in localhost http://localhost/SilverlightApplication2/SilverlightApplication2TestPage.aspx it is returning ntng

    and when i run it in VS2008 envi it is showing the same error

    plzz help me in this regard

     

     

     

     

     

     

    Monday, March 30, 2009 7:29 AM
  • Thank you, dcpace!  That was the same problem I was having.  It was in the configuration.svcinfo file not the web.config for me.  I set a specific port number to use in the VS Porject Properties.

    Friday, June 05, 2009 1:49 PM
  •  Hello,

    I'm in the same case as Hazz and got the same CommunicationException so i tried everything that i found on this forum and on internet :

    -Changing the binding to basicHttpBinding

    -Adding clientaccesspolicy.xml and crossdomain.xml to the root of both webservice and client

    -Removing <identity><dns value="localhost"/></identity>

    -Selecting a specific port

    -Changing my ObservableCollectin to a List

     I really need help plz.

     

    Tuesday, June 09, 2009 7:48 AM
  • Are you getting this error when you are debugging through VS?  If so, check the previous two posts.  You might be using VS virutal IIS and the port number might have changed.  You can use a specified port by going to Project properties, then make sure you update the configuration.svcinfo file because it will have a different port number, thus it thinks it is coming from a different domain.

    Tuesday, June 09, 2009 9:52 AM
  • Thanks for your fast answer ! 

    I'm debugging through VS2008. I'm using the VS Development server on a specific port : 2044 (the same since the beginning) and in my configuration.svcinfo, i checked that the endpoint address was right : http://localhost:8731/Design_Time_Addresses/ProductService/Service1/ and the serializedValue is the same.

    Wednesday, June 10, 2009 3:38 AM
  • Yeah.  Change the localhost port to 2044 on the service URI in the configuration.svcinfo:

    http://localhost:2044/Design_Time_Addresses/ProductService/Service1/

    Wednesday, June 10, 2009 7:38 AM
  • In fact i can't access to my webservice from another domain like http://localhost:2044/Design_Time_Addresses/ProductService/Service1/. I guess that it's a crossdomain problem and i put a clientaccesspolicy.xml and crossdomain.xml to the root of my webservice project but it doesn't seem to work.

    Thursday, June 11, 2009 2:41 AM
  • hi,

    Instead of putting it their just put that in C:\Inetpub\wwwroot folder and check whether http://localhost/crossdomain.xml and http://localhost/clientaccesspolicy.xml runs fine.

    Hope this solves your problem.

    Thursday, June 11, 2009 4:37 AM
  • Is the service in the same solution as your silverlight application in visual studio?  Try this: right-click the Service1.svc file in the soltuion explorer in VS and click on Browse.  Whenn the browser comes up, copy the URL and  that URL for the service end point.  The other thing that you can try is to delete the service reference from your silverlight application and re-add it. 

    Thursday, June 11, 2009 8:03 AM
  • Hi,
    I have a silverlight application which works fine on my local system.But gives me error while hosted in IIS.

    I have a Silverlight-Enabled WCF service in "MyProject.Web" project.A service reference in silverlight project is hosting that WCF.
    (MyProject.Web and silverlight app are in same solution).Everything works fine on my localsystem.But the application fails in IIS throwing the following exception:
    An error occured while trying to make a request to URI 'http://localhost:2727/Service.svc'.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 ita llows SOAP-related HTTP headers to be sent.Please see the inner exception for more details.


    Can anyone please suggest how to overcome this error.I have added both policy files but I think they are not detected at all.Pls suggest where the files should be added or some other solution.

    Thursday, June 11, 2009 9:34 AM
  • If you published it to your local IIS, do you still need the port 2727?  Try removing the port number from the configuration.svcinfo file. 

    Thursday, June 11, 2009 10:56 AM
  • Thanks everybody, i solved the problem adding a WCF project to my Silverlight so i haven't any crossdomain issue.

     

    Monday, June 15, 2009 2:51 AM
  •  

    hi,

    Instead of putting it their just put that in C:\Inetpub\wwwroot folder and check whether http://localhost/crossdomain.xml and http://localhost/clientaccesspolicy.xml runs fine.

    Hope this solves your problem.

     

     Had The Issue. Works When i Put it in InetPub.. Thanks a Lot...

     

    Sriram

    Tuesday, June 23, 2009 3:17 AM
  • My pleasure Smile

    Tuesday, June 23, 2009 3:46 AM
  • Thanks, crossdomain.xml worked for me too, but don't forget to delete clientaccesspolicy.xml or it'll just get ignored.  I'm not really happy with this as a solution, but it's nice to move on and do something else for a bit too.

    Changing ObservableCollection to Generic.List seems to be a fairly random suggestion, I can't see how it will make any difference.

    Monday, August 10, 2009 7:18 AM
  • hi , can  u help me if u have the solve problem  what u  have face for cross domain . i tried a lot to fix this problem  i am not able to do this plz help me how to slove this issue

    Thursday, August 13, 2009 10:09 AM
  • Hi sudarajan.  Can you explain your situation a little bit more?  What is the problem you are having and what exactly have you tried?  Do you have the client policy file in the www root folder?  Are you getting this error when you debug through Visual Studio? 

    Thursday, August 13, 2009 10:42 AM
  • please make another *.svc file then it will be perfect.never hang out try to do messy things.

    Tuesday, August 18, 2009 6:53 AM
  •  

    don't worry please remove

    <identity>

    <dns value="localhost"/>

    </identity>

    Section from your web.config/app.config file.

     

    Tuesday, August 18, 2009 8:26 AM
  • Hi,

    If your Project contains .dbml file then please check whether that file has serialization Mode set to Unidirectional.

    HTH Smile

    Tuesday, August 18, 2009 8:41 AM
  • try the following, taht helped me in ServiceReferences.ClientConfig file in SilverLight Application Project change name of endpoint to its IP for example I had: and changed to and it worked for me! I don't know what is the core difference but this is the fact ...
    Thursday, September 03, 2009 9:14 AM
  •  Hi .. I am trying to access a service that i hosted in IIS with SSL in localhost.

    I added serviceReference to Silverlight using https and it get added correctly.

    But when i try to invoke the service method I get following error

     

    "An error occurred while trying to make a request to URI 'https://dhk82bs.bspl.ho/MA_WCF/BudgetService.svc'. 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."

    But there is a crossdomain.xml in  https://dhk82bs.bspl.ho/MA_WCF/ceossdomain.xml and also in https://dhk82bs.bspl.ho/crossdomain.xml

     

    Invoking app is using http and not https. Suggest some solution for this problem.. 

     

    Thanks in advance

     

    Tuesday, September 08, 2009 1:49 AM
  • Hi, Check this: http://chakkaradeep.wordpress.com/2008/05/31/silverlight-and-wcf/ HTH Smile

    Tuesday, September 08, 2009 2:04 AM
  •  No that link only explain abt how to use normal WCF bervice in VS server . In that case my app also works fine. But using IIS server problem arises.

    Tuesday, September 08, 2009 5:49 AM
  • Copying the crossdomainpolicy.xml into the service folder should fix the issue.

     I Had the same issue and got solves by copying the mentioned file

    Regards

    Akhil

    Mark as answer if helpfull

    Thursday, October 08, 2009 5:39 AM
  • .style1 { color: #FF0000; }

    The errorwith inner message at the following form, if occurs after abnormal termination

    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.

    then the problem most probably occured because of the fact that the client side is keeping previous port number for the WCF. In order to solve quickly, simply follow the steps as stated belor:

    i.  Rename the service at client (silverlight) side.

    ii. Re-discover the service.

    iii. Add new service and give the previously used name.

    iv. Remove the old service.

    Saturday, October 17, 2009 4:18 PM
  •  I have not read all the posts in this thread but I had the same symptom, and here is my gem of a solution: 

     I copied the crossdomain.xml and clientaccesspolicy.xml files from the virtual root folder of the service on IIS that I was trying to access through basicHttp binding TO the root of the WEB SITE ITSELF!  My Silverlight app took off.

    Wednesday, October 21, 2009 5:40 PM
  • I have a test WCF service with only 1 test method. The service exposes basicHttpBinding endpoint and in hosted in IIS 6.0. The service uses integrated windows authentication.

     

    I am able to consume the service with a windows client without any issue. With the Silverlight 3 client I am getting the following exception:

     Exception Message------------------------An error occurred while trying to make a request to URI 'http://SERVER:8090/Service.svc'. 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. Inner Exception --------------------

    {System.Security.SecurityException ---> System.Security.SecurityException: Security error.

       at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)

       at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClass5.<EndGetResponse>b__4(Object sendState)

       at System.Net.Browser.AsyncHelper.<>c__DisplayClass2.<BeginOnUI>b__0(Object sendState)

       --- End of inner exception stack trace ---

       at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)

       at System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)

       at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)}

     To resolve this I created and placed the ClientAccessPolicy.xml and crossdomain.xml files in the root folder of my WCF service (http://SERVER:8090/clientaccesspolicy.xml). This file is also getting successfully downloaded when the SL client calls the service. Here is the content of ClientAccessPolicy.xml (pretty standard, I am allowing all domains and all headers)<?xml version="1.0" encoding="utf-8" ?><access-policy>  <cross-domain-access>    <allow-from http-request-headers="*">      <domain uri="*" />    </allow-from>    <grant-to>      <resource path="/" include-subpaths="true"/>    </grant-to>  </cross-domain-access>

    </access-policy>

     

    The web.config of the WCF service looks like this:

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <system.serviceModel>
        <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
        <bindings>
          <basicHttpBinding>
            <binding name="basicHttpBindingConfig">
              <security mode="TransportCredentialOnly">
                <transport clientCredentialType="Ntlm"/>
              </security>
            </binding>
          </basicHttpBinding>
        </bindings>
        <behaviors>
          <serviceBehaviors>
            <behavior name="ServiceBehavior">
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="false" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <services>
          <service behaviorConfiguration="ServiceBehavior" name="PWRTestService.Service">
            <endpoint address="" binding="basicHttpBinding"
                bindingConfiguration="basicHttpBindingConfig" contract="PWRTestService.IService" />
          </service>
        </services>
        <client>
          <endpoint address="http://SERVER:8090/Service.svc"
              binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService"
              contract="PWRServiceReference.IService" name="BasicHttpBinding_IService" />
        </client>
      </system.serviceModel>
    </configuration>
     

    The client reference configuration is:

    <configuration>
     <system.serviceModel>
      <bindings>
       <basicHttpBinding>
        <binding name="BasicHttpBinding_IService" maxBufferSize="2147483647"
                        maxReceivedMessageSize="2147483647">
         <security mode="TransportCredentialOnly" />
        </binding>
       </basicHttpBinding>
      </bindings>
      <client>
       <endpoint address="http://SERVER:8090/Service.svc"
                    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService"
                    contract="PWRServiceReference.IService" name="BasicHttpBinding_IService" />
      </client>
     </system.serviceModel>
    </configuration>

    I have already tried the following:

    1. Copied the clientaccessploicy.xml in c:\inetpub\wwwroot

    2. Tried almost all steps given in this and other posts.

    But the exception has not been resolved. Any help will be appreciated.

    Tuesday, November 03, 2009 3:35 AM
  • Hi,

    Try changing the endpoint address of your client config file from server to the server IP and rebuild the solution.

    Hope that helps.

    Tuesday, November 03, 2009 3:46 AM
  • Hi,

    Try changing the endpoint address of your client config file from server to the server IP and rebuild the solution.

    Hope that helps.

    Sorry I tried that as well bt it does not work.

    Tuesday, November 03, 2009 4:01 AM
  • Did you check with Firewall?

    Tuesday, November 03, 2009 4:06 AM
  • Did you check with Firewall?

    There is no issue with firewall. I am able to consume the service fro asp.net hosted alongwith the silverlight application.

    Tuesday, November 03, 2009 4:17 AM
  • Nitinpa,

    I dont know if either of these suggestions will help but they solved my similar problem sometime ago so I thought I'd share them

    Do you have your crossdomain.xml and clientaccesspolicy.xml in the root of the application?

     If not, here is a quick and dirty version of both you can use.

    clientaccesspolicy.xml

    <?xml version="1.0" encoding="utf-8"?>
    <access-policy>
      <cross-domain-access>
        <policy>
          <allow-from http-request-headers="*">
            <domain uri="http://*"/>
            <domain uri="https://*" />
          </allow-from>
          <grant-to>
            <resource path="/" include-subpaths="true"/>
          </grant-to>
        </policy>
      </cross-domain-access>
    </access-policy>

    crossdomain.xml

    <?xml version="1.0" encoding="utf-8"?>
    <cross-domain-policy>
      <allow-http-request-headers-from domain="*" headers="*"/>
    </cross-domain-policy>

    One other problem I had when I first started using silverlight is that visual studio would pick a random port number for testing and when the project was built, it saved that port number in the service reference.  - A week later, visual studio had picked another port but did not update the service references.  -  I have since learned to set all of my projects to a specific port in the project.web properties window before creating my service references. - If you need to change the port number, I have found it is easier to fix the port, then delete and recreate the service reference than to try to chase down everywhere the old port number lives. - You don;t have to delete the service itself, just the reference and recreate. - Finally check your web.config for port number issues.

     

    Hope this helps. At the least it is two more things to check off the list as not the problem. - HAHA

    Tuesday, November 03, 2009 10:03 AM
  • I have created a Visual Studio 10 online item template to facilitate creation of client access policy files for Silverlight applications. You can access this by searching online item templates in the Add | New Item dialog for an existing Visual Studio Project, or by installing the template from here: http://visualstudiogallery.msdn.microsoft.com/en-us/83ad9abd-5212-4f8d-9d4f-4fd4319c5731.

    Thanks,
    Tomasz Janczuk

    Tuesday, November 03, 2009 7:04 PM
  • Hi all,

    I read your blogs, which is almost similar to error which I am facing and tried to implement the same to solve the error.

    But still the error continues.

    I have a silverlight application which I have created along with a auto generated test page or host page. I add a web reference to live search in it.http://api.search.live.net/search.wsdl?AppID=MyappID this link which works perfectly fine in simple ASP.net web application.

    The main problem is I am getting LiveSearchPortTypeClient other than LiveSearchService and other main thing is when I run my application it gives me error :

    "An error occurred while trying to make a request to URI 'http://api.search.live.net/soap.asmx'. 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. Please see the inner exception for more details."

    Here is the code snippet for accessing the livesearch utility

    LiveSearchPortTypeClient LSService = new LiveSearchPortTypeClient();

    SearchRequest SRequest = new SearchRequest();

    SRequest.Sources = new SourceType[1] { SourceType.Image };SearchResponse SResponse = new SearchResponse();

     

    try

    {

    SRequest.AppId = "CEC7D29B6830FA21FD564EB502DA6126D8CB6A75";SRequest.Query = "india";

    SRequest.Version = "2.0";

    SRequest.Market = "en-us";

    SRequest.Adult = AdultOption.Moderate;

    SRequest.AdultSpecified = true;

    SRequest.Image = new ImageRequest();SRequest.Image.Count = (uint)6;SRequest.Image.Offset = (uint)0;

     

     

    LSService.SearchCompleted +=
    new EventHandler<SearchCompletedEventArgs>(LSService_SearchCompleted);

    LSService.SearchAsync(SRequest);

    }

    catch (System.Net.WebException ex)

    {

    ErrorLbl.Text =
    "Network connection failure.";

    ErrorLbl.Visible = true;

    return;

    }

    I have not added cross daimain policy file in my application.

    can anybody tell me how could I solve this error 

    Wednesday, December 02, 2009 6:15 AM
  • Hi ,

    I got solution for this error.

    Step1: before using WCF serive you have to add  Two XML files in C:\Inetpub\wwwroot

     

    clientaccesspolicy.xml :

     

    <?xml version="1.0" encoding="utf-8"?>

     

    <access-policy>

     

      <cross-domain-access>

        <policy>

          <allow-from http-request-headers="*">

            <domain uri="*"/>

          </allow-from>

          <grant-to>

            <resource path="/" include-subpaths="true"/>

          </grant-to>

        </policy>

      </cross-domain-access>

    </access-policy>

     

    2.crossdomain.xml:

     

    <?xml version="1.0"?>

    <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">

    <cross-domain-policy>

      <allow-http-request-headers-from domain="*" headers="*"/>

      <allow-http-request-headers-from domain="*" headers="SOAPAction" />

     

    </cross-domain-policy>

     

    Step 2: Next you have to deploy WCF service before using In silverlight because With out deploy in IIS your service URL like below http://localhost:3049/GlobalServices/EmpService.svc

    Because of Port numbers you will get error in Silverlight for avoid this Deploy your WCF service using Web project deployment techniques .

    After deploy in IIS , your URL like below

    http://localhost/GlobalServices/EmpService.svc

     

    Now it will work perfectly .

    Please let me know if any thing need .

     

     

    Tuesday, December 08, 2009 8:15 AM
  •  I follow the given steps and it really solve the problem ie

    1. Copy the clientaccesspolicy.xml and crossdomain.xml in wwwroot folder
    2. deploy the webservice through a project or though the WCF Service
    This will really solve u r problem
    Friday, January 08, 2010 4:25 AM

  • Friday, January 08, 2010 4:27 AM
  •  I had the same error. I have a silverlight project and a webservices project. I use the webservice to connect to the DB and populate some values in my silverlight project. Here is what I did

     1) Copy clientaccesspolicy.xml and crossdomain.xml into wwwroot

    clientaccesspolicy.xml:

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

    crossdomain.xml

    <?xml version="1.0"  ?>
    <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
    <cross-domain-policy>
      <allow-http-request-headers-from domain="*" headers="*"/>
    <allow-http-request-headers-from domain="*" headers="SOAPAction" />
    </cross-domain-policy>

     2) In ServiceReferences.ClientConfig I had to use IP of the server instead of localhost in endpoint address. Here it is:

    <configuration>
        <system.serviceModel>
            <bindings>
                <basicHttpBinding>
                    <binding name="ServiceSoap2" maxBufferSize="2147483647"
                        maxReceivedMessageSize="2147483647">
                        <security mode="None">
                            <transport>
                                <extendedProtectionPolicy policyEnforcement="Never" />
                            </transport>
                        </security>
                    </binding>
                </basicHttpBinding>
            </bindings>
            <client>
                <endpoint address="http://<your server IP or server name>/Service.asmx"
                    binding="basicHttpBinding" bindingConfiguration="ServiceSoap2"
                    contract="Service.ServiceSoap" name="ServiceSoap" />
            </client>
        </system.serviceModel>
    </configuration>



     

     

     

    Wednesday, April 07, 2010 10:04 PM
  • I've had this error serveral times before, but this time indeed it was fixed by in the properties of the web project, changing the Development Server from 'auto-assign port' to 'specific port' and updating the WCF service reference to use the new, fixed port. Thank you dashcream!
    Tuesday, April 20, 2010 3:23 AM
  • Thanks. This works for me.

    I have Copy and Paste the clientaccesspolicy.xml and crossdomain.xml into  wwwroot folder (C:\Inetpub\wwwroot\) and it works.

    Sunday, May 16, 2010 11:57 PM
  • How did it get resolved?

    Monday, June 28, 2010 4:55 PM
  • My issue was where to place these files when consuming a WCF service for a Silverlight control, when the WCF was running locally through VS.NET (for debugging purposes).  This is what I did to fix the problem (only applicable to this described scenario):

    Fixing the "attempting to access a service in a cross-domain way..." error when consuming a WCF service running via a VS.NET 'localhost' binding

    http://allen-conway-dotnet.blogspot.com/2010/07/fixing-attempting-to-access-service-in.html

     

    Wednesday, July 07, 2010 3:39 PM
  •  Thank you very much sriram ramsway :) single line solved many hazels

    Regards

    Mohan

    Thursday, July 08, 2010 9:31 AM
  • Guys  one more thing to check is the default browser you are using. I was getting the same error when debuggging and I changed my default browser from firefox to IE and this solved my problem. All my policy files were in correct place.

     

     

    Monday, August 09, 2010 10:04 PM
  • Problem solved.

    Thanks

    Friday, September 10, 2010 12:17 PM
  • Edited

    Monday, September 13, 2010 1:53 PM
  • I have placed teh xml file at teh appropriate location, but still getting teh cross domain err, anything else to do than this, plz help??

    Thanks in advance.

    Rajat.

    http://rajatnigam1.blogspot.in/

    Tuesday, October 19, 2010 9:55 AM
  • You may want to visit this thread: http://forums.silverlight.net/forums/t/204997.aspx


    Thursday, October 21, 2010 8:18 PM
  • I've had this same thing happen to me twice now this week.  The first time was the port changing as others mentioned above, but just today I got the same error for a different reason.  I have a single solution with two projects - one for the silverlight app, and one for the web service.  It took me a little while to figure it out, but my startup project had magically changed from the .Web service project to the silvelight app project.  Changing it back to the .Web project fixed this issue for me.

    Jason

    Thursday, November 04, 2010 1:17 PM
  • Hi,

     

    I has the same problem after read an read about crossdomain, clientaccesspolicy etc... i has detected that i don´t need to change nothing, i have the problem debugging in VS2008, the issue is that VS2008 change the startup project by the silverlight project, instead of Webproject.

     So you only need to set the webproject as startup project.

    Issue solved, i hope this can help somebody

    Thanks to all.

    Wednesday, November 10, 2010 8:02 AM
  • Hi,

    I'm also experiencing the same issue in my SL OOB application.

    {System.Net.WebException: The remote server returned an error: NotFound. ---> System.Net.WebException: The remote server returned an error: NotFound.
       at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
       at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClass5.<EndGetResponse>b__4(Object sendState)
       at System.Net.Browser.AsyncHelper.<>c__DisplayClass2.<BeginOnUI>b__0(Object sendState)
       --- End of inner exception stack trace ---
       at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)
       at System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
       at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)}
    The remote server returned an error: NotFound.

    {System.Net.WebException: The remote server returned an error: NotFound. ---> System.Net.WebException: The remote server returned an error: NotFound.

       at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)

       at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClass5.<EndGetResponse>b__4(Object sendState)

       at System.Net.Browser.AsyncHelper.<>c__DisplayClass2.<BeginOnUI>b__0(Object sendState)

       --- End of inner exception stack trace ---

       at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state) at System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)   at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)}

    The remote server returned an error: NotFound.

    I have applied both clientaccesspolicy.xml and the crossdomain.xml in the root folder of the WCF service and the C:\inetpub\wwwroot\ folder. The exception still persists. 

    can anybody please help me.

    Thanks & Regards,

    Reejesh


    Thursday, November 11, 2010 11:50 AM
  • Firstly, sorry for replying to your (Leonardo_u) comment, but I cannot seem to find out where to post a new comment...

    Ok, after quite a struggle tonight I found out how to solve this...well, for me anyways.

    1. Add the crossdomain.xml and clientaccesspolicy.xml files to the root of your web app hosting the service
    2. Host the service in the web app, then right-click in your Silverlight apps' service reference and select update reference
    3. Update the reference by pointing it to your newly hosted service, NOT your localhost one
    4. Delete the /clientbin/*.xap files (mine did not replace this with a new one unless it was deleted)
    5. Clean solution (r-click - make clean)
    6. Rebuilt solution
    7. Delete files from the published website (mine did not overwrite files with new ones)
    8. Re-publish site
    9. Clear your browsers cache to make sure it gets your new SL app

    If you get the error again, read and check where it is actually trying to access the service...if it's hosted and it's looking for the service as a localhost:????, something is wrong, find out where it's getting that from...mine was the service reference.

    Hope this helps someone because it frustrated me a lot.

    Pieter

    Monday, November 29, 2010 5:46 PM
  • Hi,

    Did you solved your issue? I am facing same issue.

    I got following exception while using Reporting Service(ReportService2005.asmx) with Silvelight.

    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.

    I am getting error following service reference class.

    public string EndCreateSubscription(System.IAsyncResult result) {

    object[] _args = new object[0];

    string _result = ((string)(base.EndInvoke("CreateSubscription", _args, result)));

    return _result;

    }

    I have put ClientAccessPolicy.xml & crossdomain.xml on root folder of ReportService(ReportService2005.asmx).

    Please do needful.

    Saturday, January 01, 2011 3:41 AM
  • I think the definite solution is.

    1.fix the port no in your webservce usinbg webservice property -> web tab

    2. palce these files in your WCFClient and WCFService Project and inetpub->wwwroot folder.

    clientaccesspolicy.xml 
    <?xml version="1.0" encoding="utf-8" ?>
    - <access-policy>
    - <cross-domain-access>
    - <policy>
    - <allow-from http-request-headers="*">
      <domain uri="*" />
      </allow-from>
    - <grant-to>
      <resource path="/" include-subpaths="true" />
      </grant-to>
      </policy>
      </cross-domain-access>
      </access-policy>

    crossdomain.xml
    <?xml version="1.0" ?>
      <!DOCTYPE cross-domain-policy (View Source for full doctype...)>
    - <cross-domain-policy>
      <allow-http-request-headers-from domain="*" headers="*" secure="true" />
      </cross-domain-policy>

    once try it using http://localhost/crossdomain.xml.








    Tuesday, January 18, 2011 2:19 AM
  • Thank You.... hazz

    Thursday, February 10, 2011 3:58 AM
  • Hi,

    I have a self hosted WCF 4 service, catering the same contract via basicHttpBinding for Silverlight 4 clients and wsHttpBinding for the others.

    I get the following error when trying to access the a service method from WCF:

    Message=An error occurred while trying to make a request to URI 'http://localhost:8008/WCF4Silverlight.MyService/SL'. 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.

    I do have the method, GetClientAccessPolicy() serving the cross-domain policy using WebGet attribute, and I am kind of sure that there is a problem with it getting exposed properly. Your insight into the problem will be highly appreciated.

     Here is the code for the WCF service:

     namespace WCF4Silverlight
    {
        [ServiceContract(SessionMode = SessionMode.NotAllowed)]
        public interface IClientAccessPolicy
        {
            [OperationContract, WebGet(UriTemplate = "/clientaccesspolicy.xml")]   
            Stream GetClientAccessPolicy();
        }
    }

    namespace WCF4Silverlight
    {
    public class MyService: IMyService, IClientAccessPolicy
    {

    public Stream GetClientAccessPolicy()
    {
    const string result = @"<?xml version=""1.0"" encoding=""utf-8""?>
    <access-policy>   
    <cross-domain-access>       
    <policy>           
    <allow-from http-request-headers=""*"">               
    <domain uri=""*""/>           
    </allow-from>           
    <grant-to>               
    <resource path=""/"" include-subpaths=""true""/>           
    </grant-to>       
    </policy>   
    </cross-domain-access>
    </access-policy>";

    if (WebOperationContext.Current != null)               
    WebOperationContext.Current.OutgoingResponse.ContentType = "application/xml"; return new MemoryStream(Encoding.UTF8.GetBytes(result));
    }
    }

    //Other service methods....
    }

    Here is code that publishes the service:

    class Program
    {
     static void Main(string[] args)
     {
      ServiceHost myServiceHost = new ServiceHost(typeof(MyService));
      myServiceHost.Open();
      
      myServiceHost.Close();
     }
    }

    Here is the app.config for the WCF service host:

    <service name="WCF4Silverlight.MyService" behaviorConfiguration="MyServiceBehavior">
     <host>
       <baseAddresses>
      <add baseAddress="http://localhost:8008/MyService/"/>
       </baseAddresses>
     </host>
     <endpoint address="general" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IMyService" contract="WCF4Silverlight.IMyService"/>
     <endpoint address="SL" binding="basicHttpBinding" bindingConfiguration="basicHttpBinding_IMyService" contract="WCF4Silverlight.IMyService"/>
     <endpoint address="" binding="webHttpBinding" bindingConfiguration="webHttpBinding_IMyService" behaviorConfiguration="webHttpBehavior" contract="WCF4Silverlight.IClientAccessPolicy" />
    </service>And here is the ServiceReferences.ClientConfig for the Silverlight client:

    <system.serviceModel>
     <bindings>
      <basicHttpBinding>
       <binding name="BasicHttpBinding_IMyService" maxBufferSize="2147483647"
        maxReceivedMessageSize="2147483647">
        <security mode="None" />
       </binding>
      </basicHttpBinding>
      <customBinding>
       <binding name="WSHttpBinding_IMyService">
        <textMessageEncoding messageVersion="Default" writeEncoding="utf-8" />
        <httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
       </binding>
      </customBinding>
     </bindings>
     <client>
      <endpoint address="http://localhost:8008/MyService/SL"
       binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IMyService"
       contract="myWCFService.IMyService" name="BasicHttpBinding_IMyService" />
     </client>
    </system.serviceModel>

    Please let me know if more information is needed.


     

     

     

     

     

     

    Wednesday, February 16, 2011 4:54 PM
  • Make sure to check that you enabled the Use Local IIS Web Server option under Web tab for your web hosting project and create a virtual directory when prompted, prevents use of Cassini.

    Run Visual Studio as administrator.

    Thursday, April 07, 2011 10:04 AM
  • it is just faint port or service address :)

    Tuesday, May 03, 2011 3:33 AM
  • i atached my Webservice again and now working fine

    Sunday, May 22, 2011 9:08 AM
  • I ALSO TRIED BY PUTTING IN ROOT FOLDER BUT IT NEVER WORKED. BUT WHEN I COPIED INTO INETPUB\WWWROOT FOLDER IT WORKED PERFECTLY. 

    Thursday, September 01, 2011 4:30 AM
  • hi to all,

    i followed whtever u mentioned in above solution. but still m getting the same error oly.

    for me one doubt,

    root directory means wether 1. the iis root  or 2. portal root or 3. servie hosted root or 4. silverlight application root ah.

    pl help me for this problem

     

    thanks in advance to all

    Friday, September 09, 2011 3:42 AM
  • I faced the same problem but after placing crossdomain.xml in the root web directory now its working Smile

    Wednesday, December 14, 2011 5:05 AM
  • hi ramyaprabha,

    the clientdomainpolicy.xml should be placed in the root directory of the web service. For ex: your service is placed in http://exampleroot/yourservice. the clientdomainpolicy.xml should be placed in http://exampleroot.

    I hope this will help you.

    Tuesday, February 07, 2012 3:44 AM
  • Yes, Avinash Ranjan suggestion works for me.

    Tuesday, February 07, 2012 4:36 AM
  • Placing crossdomain.xml and clientaccesspolicy.xml into C:\Inetpub\wwwroot folder fixed the problem I was struggling with for two days.

    Thanks a lot.

    Wednesday, April 04, 2012 10:58 AM
  • If you have a specific server which is hosting reporting services (SQL 2008 / 2012 Reporting Services) without IIS. ie http.sys, then where is the default domain root so we can place the crossdomain.xml file?

    Or do we have to install IIS just to serve this single file?

    Monday, January 28, 2013 11:24 PM
  • Hi;

    I've run into this error too, but even after putting the clientaccesspolicy.xml file and the crossdomain.xml files into my c:\inetpub\wwwroot directory, nothing changes.  I am using the files that have been listed here for these as well.  Can anyone point to something else I can try?  I've been stuck for several days now and don't know how to proceed.

    -Bob

    Thursday, February 28, 2013 3:30 PM
  • If using code, ensure your endpoint is fully qualified.

                MonitorSvcEndPointAddress = "http://myserver:8080/DataService/DataService.MonitorService.svc";  // does not work

                MonitorSvcEndPointAddress = "http://myserver.managed.local:8080/DataService/DataService.MonitorService.svc";  // works


    macrel

    Tuesday, April 30, 2013 3:57 PM
  • I updated the port # of the localhost in the ServiceReferences.ClientConfig file and configuration.svcinfo file to the new port# in VisualStudio. Everything worked fine.

    Monday, February 17, 2014 8:21 PM