none
Silverlight calling WCF service getting error 503

    Question

  • I have a custom WCF service that is deployed to Central Admin. This service works fine with a regular web part. I am writing a silverlight application that will perform basically the same funcitons as this web part, and so I need to call this web service. But whenever I make a call and silverlight tries to download the clientaccesspolicy.xml file, it gives a service unavailable error. I am also unable to browse this xml file from IIS or directly from the browser. I have the file in the root of the Web Service web app, and looking at the requests in Fiddler, I am sure that the file is in the right place. But for some reason I keep getting this service unavailable error. I can browse all the services just fine, but not this file. Any thoughts on why this is happening?
    Friday, August 26, 2011 12:48 AM

All replies

  • Please confirm that the file(ClientAccesspolicy.xml)  must be located in the respective virtual directory, so that you will be able to browse it directly in your browser e.g. http://ServerName:Portnumber/ClientAccesspolicy.xml
    Friday, August 26, 2011 5:01 AM
  • Please verify if you have placed the ClientAccesspolicy.xml as well as Crossdomain.xml file in the root directory.

    Also have a look at the following link 

    http://timheuer.com/blog/archive/0001/01/01/silverlight-cannot-access-web-service.aspx

     

    Regards,

    Geetanjali


    Thanks & Regards, Geetanjali Arora
    Friday, August 26, 2011 6:26 PM
  • The Web Service root folder is not located in the Virtual Directory and there is no virtual directory folder with the web service's port.

    I have used Tim's post quite a bit in my troubleshooting and development and have followed all of his steps. In Fiddler I can see the requests go out for both the ClientAccesspolicy.xml as well as Crossdomain.xml and both get a 503 error. Also, the Crossdomain.xml file is not necessary if you have the clientaccesspolicy.xml file. But I did try it with both just to be sure.

    Friday, August 26, 2011 7:16 PM
  • Well I was stuck with this issue and I would tell you what all things I did. Maybe any of these might solve your issue. All the best as Silverlight calling WCF really got me crazy. Just try once what all I did to make it work at my end.

    • Make sure that crossdomain.xml and clientaccesspolicy.xml are in the WCF application folder published on IIS
    • Also to avoid any confusion I placed it in C:\inetpub\wwwroot location also
    • Still things were not working so I checked my APP Pool Identity linked to my wcf application and changed it to my sharepoint admin. By default it was ApplicationPoolIdentity

    After doing all these changes it worked for me. All the Best !


    Thanks & Regards, Geetanjali Arora
    Friday, August 26, 2011 7:38 PM
  • Thanks for the suggestions, but no luck here.

    I probably should have posted this in the first place, but here is the error message:

    An error occurred while trying to make a request to URI 'http://server:32843/9006e5c21926483f97cf42c14ce974d3/Service.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.

    I also tried adding the InternalsVisibleToAttribute to every file in my service, but that had no effect.

     

    Saturday, August 27, 2011 12:55 AM
  • Please have a look at the following link and see if it helps.

    http://forums.silverlight.net/t/63112.aspx

     


    Thanks & Regards, Geetanjali Arora
    Saturday, August 27, 2011 6:42 AM
  • No luck with anything there either.  My best guess right now is that the problem has something to do with  the web app that hosts web services in SharePoint not mapping to a physical web site(no virtual directory). But I would also find it hard to believe that what I am trying to do is an uncommon thing. 

     

    Tuesday, August 30, 2011 1:02 AM
  • What are the app pool identity credentials for your web service application and your sharepoint web app? 
    Thanks & Regards, Geetanjali Arora
    Tuesday, August 30, 2011 2:53 AM
  • It is a service account that is a local administrator on the SharePoint machine. Most of the services run under those credentials as well, including the Web Services app pool. This account is also a sysadmin on the SQL database.
    Wednesday, August 31, 2011 9:55 PM
  • Hi Matt,

    Did you manage to solve the issue ? 

    Regards,

    Geetanjali

    Sunday, September 04, 2011 5:11 PM
  • Have not been able to solve this problem as of now. I've had to put it aside for now because it was taking so long. I am still looking for a solution though!
    • Edited by Matt Smolich Tuesday, September 27, 2011 11:48 PM
    Monday, September 12, 2011 9:40 PM
  • So I finally got another chance to work on this, and managed to do a work around of sorts. I made a regular IIS web site and hosted a service in that that calls the SharePoint service. So the silverlight code calls the 'proxy' web service which then calls the real web service. Not ideal, but it does work. The best thing I can think of for these problems is that the IIS website has a definite physical path for all its files, whereas the SharePoint sites do not. I think this is why the clientaccesspolicy file was inaccessible from SharePoint, but works perfectly fine with the IIS site. Can anyone confirm this thought?
    Tuesday, November 08, 2011 1:23 AM