I think the problem is something different regarding publishing. I have copied the website files to a hosting company, and when using the service reference - localhost it is working from my development pc, but not for other pcs, as they do not have the localhost
open. Do I need to set something up in IIS or maybe change the endpoint of the service reference not to use localhost??
I have only copied the files to my domain at surftown.com nothing else.
Do you mean to access WCF which is hosted in hosting company and are you trying to access that service by localhost ?
Then definately that want work, if you are accessing in you local development machine then that might be in you local computer you have configred your WCF on you local machine. Hence in development application that is accessing from your local service, but
in other machine they dont acess of your localhost, so they are facing an issue.
Let me know for more clarification, if this is the case for you.
My Tech Blogs MCPD Enterprise and Web Application
MCTS Web, Window and Enterprise Application
Do you mean to access WCF which is hosted in hosting company and are you trying to access that service by localhost ?
Then definately that want work, if you are accessing in you local development machine then that might be in you local computer you have configred your WCF on you local machine. Hence in development application that is accessing from your local service, but
in other machine they dont acess of your localhost, so they are facing an issue.
Let me know for more clarification, if this is the case for you.
Yes this is exactly what I mean. I have explained the hosting company about my problem, as I am unable just to change the ServiceReferences.ClientConfig to /MyDomain.com/*.svc/ it does not work. I have thought of hosting the domain myself. What can you suggest?
1,Change the URL to a real URL in the ServiceReference.ClientConfig before your final build.
2,If you already deployed your .Xap file to the server, and you do not want to rebuild it. You can use a WinRar tool to extract the ServiceReference.ClientConfig file out, edit the url, then use the same tool to zip it back to the .Xap file.
3,Do not rely on the URL set in the ServiceReference.ClientConfig. Set your URL in the code. Change your WCF serivice calling code to the following:
Uri address = new Uri(Application.Current.Host.Source, "../YourService.svc"); // this url will work both in dev and after deploy.
var webService = new YourWebService.YourWebServiceClient("YourServiceEndPointName", address.AbsolutePath);
Please check the following posts to know more about how to resolve this issue.
Scorgi
Member
61 Points
30 Posts
Cross domain error
Jun 23, 2011 06:24 AM|LINK
Hi,
I have created a silverlight application with a wcf reference. I have used this link
to implement both http://msdn.microsoft.com/en-us/library/cc197955(v=vs.95).aspx
crossdomain.xml and
clientaccesspolicy.xml
I still receive an error if I try to open site www.fam-sorensen.com (to see the error for yourself).
Hope that anybody can help.
r.rajeshkhun...
Participant
1358 Points
250 Posts
Re: Cross domain error
Jun 23, 2011 06:47 AM|LINK
Hi,
Please check this links....
http://blogs.msdn.com/b/carlosfigueira/archive/2008/03/07/enabling-cross-domain-calls-for-silverlight-apps-on-self-hosted-web-services.aspx
http://stackoverflow.com/questions/1364015/silverlight-wcf-service-cross-domain-question
======================================
Microsoft® Community Contributor 2011 | AWARD
MCTS
My Blog
Follow Me
amitpatel.it
Star
8070 Points
1880 Posts
Re: Cross domain error
Jun 23, 2011 06:56 AM|LINK
Place Clientaccesspolicy.xml and crossdomain.xml in root path of your wcf application.
http://forums.silverlight.net/forums/p/199338/464884.aspx
MCPD Enterprise and Web Application
MCTS Web, Window and Enterprise Application
Scorgi
Member
61 Points
30 Posts
Re: Cross domain error
Jun 23, 2011 07:11 AM|LINK
Hi, This is exactly what I need, but unfortunately there is no solution/answer to this question.
Scorgi
Member
61 Points
30 Posts
Re: Cross domain error
Jun 23, 2011 12:53 PM|LINK
I think the problem is something different regarding publishing. I have copied the website files to a hosting company, and when using the service reference - localhost it is working from my development pc, but not for other pcs, as they do not have the localhost open. Do I need to set something up in IIS or maybe change the endpoint of the service reference not to use localhost??
I have only copied the files to my domain at surftown.com nothing else.
amitpatel.it
Star
8070 Points
1880 Posts
Re: Cross domain error
Jun 25, 2011 09:07 AM|LINK
Do you mean to access WCF which is hosted in hosting company and are you trying to access that service by localhost ?
Then definately that want work, if you are accessing in you local development machine then that might be in you local computer you have configred your WCF on you local machine. Hence in development application that is accessing from your local service, but in other machine they dont acess of your localhost, so they are facing an issue.
Let me know for more clarification, if this is the case for you.
MCPD Enterprise and Web Application
MCTS Web, Window and Enterprise Application
Scorgi
Member
61 Points
30 Posts
Re: Cross domain error
Jun 28, 2011 09:09 PM|LINK
Yes this is exactly what I mean. I have explained the hosting company about my problem, as I am unable just to change the ServiceReferences.ClientConfig to /MyDomain.com/*.svc/ it does not work. I have thought of hosting the domain myself. What can you suggest?
Peter pi - M...
Star
12871 Points
1786 Posts
Re: Cross domain error
Jun 30, 2011 04:06 AM|LINK
Hi Scorgi,
You have several options to change the URL.
1,Change the URL to a real URL in the ServiceReference.ClientConfig before your final build.
2,If you already deployed your .Xap file to the server, and you do not want to rebuild it. You can use a WinRar tool to extract the ServiceReference.ClientConfig file out, edit the url, then use the same tool to zip it back to the .Xap file.
3,Do not rely on the URL set in the ServiceReference.ClientConfig. Set your URL in the code. Change your WCF serivice calling code to the following:
Uri address = new Uri(Application.Current.Host.Source, "../YourService.svc"); // this url will work both in dev and after deploy.
var webService = new YourWebService.YourWebServiceClient("YourServiceEndPointName", address.AbsolutePath);
Please check the following posts to know more about how to resolve this issue.
http://forums.silverlight.net/forums/t/19021.aspx
http://forums.silverlight.net/forums/p/151865/372452.aspx
Best regards,
</div>Peter
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework