Skip to main content

Microsoft Silverlight

Answered Question Silverlight WCF crossdomainRSS Feed

(0)

Prasad Bhalekar
Prasad B...

Member

Member

170 points

39 Posts

Silverlight WCF crossdomain

  I have created a silverlight control and linked it to an aspx page.Silverlight internally has WCF service reference and calls WCF exposed methods to populate the data.

 I have hosted my application in IIS.When i am browsing the application with server name (say:http:\\servername:port\\silverlightpage.aspx) ,the control is getting rendered properly.

  But when i  acces the application with the server ip address, it throws an cross domain issue(i.e:http:\\172.65.52.213:8080\\silverlightpage.aspx) .The silverlight controls throws an exception for crossdomain

Here is my 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>

and 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>

here is my

ServiceReferences.ClientConfig 

<configuration>

<system.serviceModel>

<bindings>

<basicHttpBinding>

<binding name="PatientCareService" maxBufferSize="2147483647"

maxReceivedMessageSize="2147483647">

<security mode="None" />

</binding>

</basicHttpBinding>

</bindings>

<client>

<endpoint address="http://simwebwds07.rsc.humad.com:7000/PatientCareService.svc"

binding="basicHttpBinding" bindingConfiguration="PatientCareService"

contract="PatientCareService.IPatientCareService" name="PatientCareService" />

</client>

</system.serviceModel>

</configuration>

After changing all above modification 

when i am refering .axpx page by url its working properly
eg. /PatientCare.Web/PatientGoal.aspx">http://<MyServer>/PatientCare.Web/PatientGoal.aspx

i am getting same error

when I refer url of .aspx page using Ip adreees

eg. /PatientCare.Web/PatientGoal.aspx">http://<MyServerIP>/PatientCare.Web/PatientGoal.aspx

thanks
Prasad Bhalekar (PP)
Please "Mark as Answer" if any of my content helped resolve the issue

preishuber
preishuber

Contributor

Contributor

3570 points

655 Posts

Answered Question

Re: Silverlight WCF crossdomain

you need nto both files only one. for trouble shooting i suggest to use httpfiddler to see if files i found and downloaded.

Also read http://timheuer.com/blog/archive/2008/04/06/silverlight-cross-domain-policy-file-snippet-intellisense.aspx

-Hannes

http://www.preishuber.net http://weblogs.asp.net/hpreishuber

pmoffatt610
pmoffatt610

Member

Member

70 points

97 Posts

Re: Silverlight WCF crossdomain

Just to add to preishuber's post, I like to use Silverlight spy 2.  Try using the http monitoring to see which request is generating an error.

http://silverlightspy.com/

It also has a crossdomain access policy validator to see if the file has errors!

Tools -> Cross-Domain Access Policy Validator

 Patrick

 

 

preishuber
preishuber

Contributor

Contributor

3570 points

655 Posts

Re: Silverlight WCF crossdomain

hi Patrick 

yfi silverlightspy doenst work on my german vista :-( 

-Hannes

http://www.preishuber.net http://weblogs.asp.net/hpreishuber

pmoffatt610
pmoffatt610

Member

Member

70 points

97 Posts

Re: Silverlight WCF crossdomain

Bummer! It's a nice little tool.  Thanks for the Info!

Respekt,

Pat

Jonathan Shen – MSFT
Jonathan...

All-Star

All-Star

24581 points

2,409 Posts

Microsoft
Answered Question

Re: Silverlight WCF crossdomain

 Hi Prasad, 

I have noticed that you have posted the same thread here.  I will mark this thread as resolved and if your problem persists there, please feel free to let me know.  We can discuss it  there.

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.

coolio
coolio

Member

Member

369 points

114 Posts

Re: Silverlight WCF crossdomain

Hannes, what's wrong with SilverlightSpy on a german vista? Happy to help you out here if you could supply me with some details on the error you are getting.

Thanks,

Koen

 

No more secrets with Silverlight Spy 3
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities