RE: wcf web service cross domain woes
"Walter Crosby" <wcrosby-FrUbXkNCsVf2fBVCVOL8/[email protected]>
| Newsgroups | gmane.comp.windows.off-topic |
|---|---|
| Message-ID | <991C9F941E3846F3BAB8C08CFDFD7AA8@WaltLaptop> |
Why not use the RIA Services stuff to handle this? http://blogs.msdn.com/brada/archive/2009/03/19/what-is-net-ria-services.aspx http://silverlight.net/getstarted/riaservices/ http://forums.silverlight.net/forums/53.aspx Walt Crosby Interval Data systems, Inc. _____ From: [email protected] [mailto:[email protected]] On Behalf Of Steve Richter Sent: Sunday, January 24, 2010 11:49 AM To: [email protected] Subject: [OT] wcf web service cross domain woes I am getting an "attempting to access a service in a cross domain way" error when calling a simple WCF web service from a silverlight3 app. I dealt with the cross domain error I got after publishing the WCF web service project to my web server. I added the ClientAccessPolicy.xml file to the wwwroot directory of the web server. Now I want to debug another error, so I have added a silverlight3 project to the WCF web service project. The theory being I will be able to use breakpoints to debug both the client and server side of the code. But my 'cross domain" error has returned when I call the web service on localhost. Any ideas? thanks, An error occurred while trying to make a request to URI 'http://localhost: <http://localhost:56605/DocService.svc> 56605/DocService.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. a simplified web service method returns a string: [ServiceContract] public interface IDocService { [OperationContract] string GetDocName2( string InDocName ); } public string GetDocName2(string InDocName) { return InDocName; } web.config has binding="basicHttpBinding" <service behaviorConfiguration="DocImageWebService.DocServiceBehavior" name="DocImageWebService.DocService"> <endpoint address="" binding="basicHttpBinding" contract="DocImageWebService.IDocService"> <identity> <dns value="localhost" /> </identity> </endpoint> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> </service> silverlight code calls the web service: DocServiceClient proxy = new DocServiceClient(); proxy.GetDocName2Completed += new EventHandler<GetDocName2CompletedEventArgs>(proxy_GetDocName2Completed); proxy.GetDocName2Async("IRS_1");