Skip to main content

Microsoft Silverlight

Answered Question Issue in Sliverlight +WCF servicesRSS Feed

(0)

pinks123
pinks123

Member

Member

24 points

32 Posts

Issue in Sliverlight +WCF services

 

  "1.0" encoding="utf-8" ?> 
- 
- 
- 
- "*">
  "*"> 
clientDomainPolicy.xml
  
- 
  "/" include-subpaths="true"> 
  
  
  
  




clientpolicy.xml
  "1.0" ?> 
  for full doctype...)> 
- 
  "*" headers="*" secure="true"> 
  
 I have wcf service in that I try to insert data using EDMX Entities object. I have Void Insertdata. And I have clientaccesspolicy.xml, crossdomain.xml files are attached. I run the services and in my client(Sliverlight application) I try to access the Insertdata method by creating proxy. Code private void SomeButton_Click(object sender, RoutedEventArgs e) { ServiceReference1.Service1Client proxy1= new DataGridGrouping.ServiceReference1.Service1Client(); proxy1.insertdataCompleted +=new EventHandler(proxy1_insertdataCompleted); proxy1.insertdataAsync(); } void proxy1_insertdataCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e) { string s = e.UserState.ToString(); } And my ServiceReferences.ClientConfig is below My Issue is: An error occurred while trying to make a request to URI 'http://localhost:8731/Design_Time_Addresses/BALWcfService/Service1/'. 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. Please help

jay nanavati
jay nana...

Contributor

Contributor

3388 points

624 Posts

Re: Issue in Sliverlight +WCF services

Where do you put the clientaccesspolicy.xml file? It should be in the root of the site where webservice resides. in you case it should be at "http://localhost:8731/Design_Time_Addresses"

Jay K Nanavaty
www.technologyopinion.com
Mark as answer if it helps. It will also help others...

koyot3
koyot3

Participant

Participant

805 points

172 Posts

Re: Issue in Sliverlight +WCF services

 try it :

in your wcf projet (i guess you're using VS 2008), right click, add new xml file and add 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>

next add 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>

create a new website in your solution, right click on it, property page, application silverlight and select your application...

set this web site as your "start" project for your solution

hope this help

johan

pinks123
pinks123

Member

Member

24 points

32 Posts

Re: Re: Issue in Sliverlight +WCF services

did lik tht..but stil throws errr.

What to do for this

koyot3
koyot3

Participant

Participant

805 points

172 Posts

Answered Question

Re: Re: Issue in Sliverlight +WCF services

 are you sure your xml files are loaded ????

look for Fiddler on google to see loading files...

are you sur that your xml files are corrects ?

MarkMonster
MarkMonster

Contributor

Contributor

5220 points

1,046 Posts

Re: Issue in Sliverlight +WCF services

When you try to access the following urls, does it return something?

 http://localhost:8731/clientaccesspolicy.xml

http://localhost:8731/crossdomain.xml

Mark Monster - MCPD Enterprise
http://mark.mymonster.nl
Silverlight and Expression Insiders UG

Dont forget to click "Mark as Answer" on the post that helped you.

Jonathan Shen – MSFT
Jonathan...

All-Star

All-Star

24939 points

2,425 Posts

Microsoft

Re: Re: Issue in Sliverlight +WCF services

Hi Pinks123,

Please reference to "HOW TO USE CROSS DOMAIN POLICY FILES WITH SILVERLIGHT".  

Best regards,

Jonathan

Jonathan Shen
Microsoft Online Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities