countrymeister
asked on
How can I access a WCF service hosted in a windows service in my silverlight app
I am trying to access a WCF service in my silverlight app (silverlight 4)
I have added the clientaccesspolicy and crosdomainpolicy files to the root directory.
But I keep getting the error - The remote server returned an error: NotFound
I have added the clientaccesspolicy and crosdomainpolicy files to the root directory.
But I keep getting the error - The remote server returned an error: NotFound
ASKER
I checked the raw output in Fiddler, the error states - Bad Request.
It gives an error on the clientaccesspolicy.xml and then an error on the crossdomainpolicy files error.
The wcf is working fine when accessed from a regular console app.
I have the two files in the location of the windows exe.
But I guess I need to make code changes to dynamically load the access policy files, which I am trying to avoid. Because this is an existing working WCF service I want to access
It gives an error on the clientaccesspolicy.xml and then an error on the crossdomainpolicy files error.
The wcf is working fine when accessed from a regular console app.
I have the two files in the location of the windows exe.
But I guess I need to make code changes to dynamically load the access policy files, which I am trying to avoid. Because this is an existing working WCF service I want to access
Save the crossdomain.xml and clientaccesspolicy.xml file to the root of the domain where the service is hosted. If, for example, the service is hosted in http://fabrikam.com, then the file must be located at http://fabrikam.com/crossdomain.xml.
ASKER
It does not work that way for a WCF service hosted in a windows service.
My windows service has bindings with some port numbers
SO it cannot find the policy files. So this has to be done via code to dynamically load the cap file.
My windows service has bindings with some port numbers
SO it cannot find the policy files. So this has to be done via code to dynamically load the cap file.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This just gave me a few things to read and dig more into
Fiddler might hlep you to give you more details on this.