Skip to main content
Home Forums Silverlight Programming Accessing Web Services with Silverlight error: attempting to access a service in a cross-domain way without a proper cross-domain policy in place
51 replies. Latest Post by tjanczuk on November 3, 2009.
(0)
hazz
Member
75 points
259 Posts
01-05-2009 2:49 PM |
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>
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
With appreciation,
Greg Hazzard
prujohn
Contributor
3579 points
704 Posts
01-05-2009 7:57 PM |
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.
01-06-2009 12:41 AM |
crossdomain.xml, where have you been all my life! Thank you for steering me in the right direction John. -hazz
<!
</
the_muso
2 points
1 Posts
01-15-2009 5:07 PM |
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?
Vaishali999
6 points
3 Posts
01-16-2009 4:36 AM |
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.
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:
Harish.S...
5 points
4 Posts
01-16-2009 7:39 AM |
Hi,
Try removing the
<identity>
<dns value="localhost"/>
</identity>
Section from your web.config file.
-Harish
01-16-2009 8:50 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
client.GetCustomersByCityAsync(textBox.Text)
dataGrid.ItemsSource = e.Result
While running above code I am getting error in following function on bold line.
foxjazzhack
14 points
44 Posts
02-12-2009 7:48 PM |
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?
02-12-2009 8:32 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>
mokarom
123 points
23 Posts
02-13-2009 9:51 AM |
Try configuring the service reference and change the Collection type from System.Collections.ObjectModel.ObservableCollection to System.Collections.Generic.List
02-13-2009 9:55 AM |
Hi Vaishalli,
Mokarom
02-13-2009 11:34 AM |
My code dies at:
}
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
02-16-2009 2:05 AM |
Thanks so much to all my error get resolved.
Vaishali
dashcream
15 points
9 Posts
03-02-2009 1:51 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?
03-02-2009 12:19 PM |
If your using WCF, work with it in a single silverlight project.
dcpace
03-02-2009 7:05 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.
03-03-2009 1:22 AM |
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!!
ravikirane
7 Posts
03-30-2009 7:29 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
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
hector_c...
34 points
20 Posts
06-05-2009 1:49 PM |
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.
KyoX94
8 points
06-09-2009 7:48 AM |
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.
06-09-2009 9:52 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.
06-10-2009 3:38 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.
06-10-2009 7: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/
06-11-2009 2:41 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.
varshavmane
6739 points
1,583 Posts
06-11-2009 4:37 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.
06-11-2009 8:03 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.
madact
4 points
2 Posts
06-11-2009 9:34 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.
06-11-2009 10:56 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.
06-15-2009 2:51 AM |
Thanks everybody, i solved the problem adding a WCF project to my Silverlight so i haven't any crossdomain issue.
Sriram R...
11 points
51 Posts
06-23-2009 3:17 AM |
varshavmane: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
06-23-2009 3:46 AM |
My pleasure
adamsurg
08-10-2009 7:18 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.
sudarajan
08-13-2009 10:09 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
08-13-2009 10:42 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?
ajay01
08-18-2009 6:53 AM |
please make another *.svc file then it will be perfect.never hang out try to do messy things.
08-18-2009 8:26 AM |
don't worry please remove
Section from your web.config/app.config file.
08-18-2009 8:41 AM |
If your Project contains .dbml file then please check whether that file has serialization Mode set to Unidirectional.
HTH
wazzzuup
09-03-2009 9:14 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 ...
svsriraj
10 points
12 Posts
09-08-2009 1:49 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
09-08-2009 2:04 AM |
Hi, Check this: http://chakkaradeep.wordpress.com/2008/05/31/silverlight-and-wcf/ HTH
09-08-2009 5:49 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.
09-08-2009 6:03 AM |
Check this:
http://blogs.msdn.com/carlosfigueira/archive/2008/03/07/enabling-cross-domain-calls-for-silverlight-apps-on-self-hosted-web-services.aspx
http://weblogs.asp.net/tolgakoseoglu/archive/2008/03/18/silverlight-2-0-and-wcf.aspx
http://www.tipsdotnet.com/TechBlog.aspx?PageIndex=0&BLID=11
Finally on Google search:
http://www.google.com/search?hl=en&q=WCF+hosting+on+IIS+%2B+could+be+due+to+attempting+to+access+a+service+in+a+cross-domain+%2B+Silverlight&aq=f&oq=&aqi=
akhi4akhil
10-08-2009 5:39 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
mehmet.k...
10-17-2009 4:18 PM |
.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.
arnieberg
10-21-2009 5:40 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.
nitinpa
11-03-2009 3:35 AM |
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:
{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)}
</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.
11-03-2009 3:46 AM |
Try changing the endpoint address of your client config file from server to the server IP and rebuild the solution.
Hope that helps.
11-03-2009 4:01 AM |
varshavmane: 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.
11-03-2009 4:06 AM |
Did you check with Firewall?
11-03-2009 4:17 AM |
varshavmane: 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.
Demian_Pace
11-03-2009 10:03 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
tjanczuk
86 points
17 Posts
11-03-2009 7:04 PM |
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