Note: Forums will be making significant UX changes to address key usability improvements surrounding search, discoverability and navigation. To learn more about these changes please visit the announcement which can be found HERE.

Dotaz Using a Silverlight WCF-Service in SharePoint

  • 4. července 2012 6:39
     
     
    Hi,

    I have a Silverlight Application, which accesses a sql database using a WCF-Service. It is working fine, when I debugg it in Visual Studio (in Browser)

    Now I have implemented this App in a SharePoint. The App itself is loading fine, but the access to the database is not working.
    What is the problem there? Does SharePoint deny the access?

    I would be grateful for any help

Všechny reakce

  • 4. července 2012 7:18
     
     
  • 4. července 2012 8:26
     
     

    How are you accessing the database from WCF service ?

    I don't know anything about your code of WCF service. I'd recommed you to instrument/trace WCF service.

    http://www.codeproject.com/Articles/65425/4-Steps-to-Enable-Instrumentation-in-WCF

    http://msdn.microsoft.com/en-us/library/ms733025.aspx


    Sundar Narasiman

  • 4. července 2012 8:39
     
     

    Thanks for you answers.

    I resolved the issue by adding a clienaccesspolicy.xml to the service.

  • 5. července 2012 9:49
     
     

    Unfortunately it is just working for me on my local machine.

    But when other people are using the Silverlight-App on the Sharepoint it is not working, because WCF Service ist located on http://localhost according to Visual Studio.

    What shall I do to make it work for everybody

    Thanks

  • 6. července 2012 7:47
     
     
  • 6. července 2012 8:47
     
     

    Unfortunately it is just working for me on my local machine.

    But when other people are using the Silverlight-App on the Sharepoint it is not working, because WCF Service ist located on http://localhost according to Visual Studio.

    What shall I do to make it work for everybody

    Thanks

    Hi,

    For the URL, replace the 'localhost' with the computer name where the service sits.

    Regards


    I find it distasteful to beg for 'Mark as Answer' and 'Mark as helpful'. It's supposed to be about helping people, not about getting the high score.

  • 6. července 2012 12:38
     
     

    Hi, 

    For the URL, replace the 'localhost' with the computer name where the service sits.

    Regards

    What do you mean with "where the service sits"? The service is integrated in the SilverilghtApp..
  • 6. července 2012 12:43
     
     

    Hi,

    The service needs to be deployed to a server, the silverlight app (xap file) is deployed to sharepoint. So deploy your service to a test service, update the url to point to the deployed service. This will allow other users to connect to your service using the silverlight app.

    Regards


    I find it distasteful to beg for 'Mark as Answer' and 'Mark as helpful'. It's supposed to be about helping people, not about getting the high score.

  • 6. července 2012 12:46
     
     


    The service needs to be deployed to a server, the silverlight app (xap file) is deployed to sharepoint. So deploy your service to a test service, update the url to point to the deployed service. This will allow other users to connect to your service using the silverlight app.

    Hi, thanks for your quick response.

    I am sorry when I ask again and again, but I am really new in all of this, so I don't get everything  ;)

    What exactly do you mean by deploying my service to a test service?

    Thanks in advance

  • 6. července 2012 12:59
     
     

    In essence what you do is create a 'web site' on the server in IIS manager, then in visual studio you publish the service to a folder on your local machine using file copy, then copy those files to the web site's folder on the server. You can then access that service, for example by using the URL: http://yourserver:portnumber/MyWCFService.svc

    Here's a link to msdn where they explain in more details: http://msdn.microsoft.com/en-us/library/aa751792.aspx


    I find it distasteful to beg for 'Mark as Answer' and 'Mark as helpful'. It's supposed to be about helping people, not about getting the high score.

  • 6. července 2012 13:33
     
     

    This would be the first time I work with IIS Manager^^

    On what Server shall I create a "web site"? I do not have a Server.... 

    I'm a bit confused here^^

  • 9. července 2012 7:30
     
     

    Hi,

    You can setup your own pc to run as a 'server' by setting up IIS on your pc. Here's a link to set up IIS on windows 7. 

    http://www.howtogeek.com/?post_type=post&p=187

    This is so that other people can access the service if they run silverlight. One question, where is your sharepoint setup? 

    Regards


    I find it distasteful to beg for 'Mark as Answer' and 'Mark as helpful'. It's supposed to be about helping people, not about getting the high score.

  • 9. července 2012 10:40
     
     

    One question, where is your sharepoint setup? 

    It is an company sharePoint, so I guess it is setup somewhere in the company intranet..
  • 9. července 2012 11:12
     
     
    Is there a development server? Deploy the web service there, otherwise, deploy to your local computer where you're doing the development.

    I find it distasteful to beg for 'Mark as Answer' and 'Mark as helpful'. It's supposed to be about helping people, not about getting the high score.

  • 9. července 2012 11:45
     
     

    Unfortunately it is not allowed to deploy a web service on the sharepoint due to our firm policy.

  • 9. července 2012 12:06
     
     

    If you are not allowed to deploy a web service then this silverlight/wcf service combination will not work for you.  In order for this to work the wcf service needs to sit on a server somewhere, if not a sharepoint server, perhaps there's a different server.

    Otherwise you'll have to look at dropping silverlight, and rather use a normal sharepoint web part, which can communicate to a database directly.

    Regards


    I find it distasteful to beg for 'Mark as Answer' and 'Mark as helpful'. It's supposed to be about helping people, not about getting the high score.

  • 9. července 2012 12:28
     
     

    There is no chance to use a wcf-service which is not deployed on a server?

  • 9. července 2012 12:49
     
     

    There is no chance to use a wcf-service which is not deployed on a server?

    Think about it, the service needs to sit somewhere... It needs to be on a server, otherwise how will you access it!


    I find it distasteful to beg for 'Mark as Answer' and 'Mark as helpful'. It's supposed to be about helping people, not about getting the high score.

  • 11. července 2012 14:47
     
     

    Okay, new status^^: it is now possible to implement a WCF-Service in the SharePoint.

    But how can I do this?^^ I read some tutorials in the internet. Everytime it says to create a new SharePoint project in Visual Studio. Unfortunatelly I don't have a SharePoint Server installed on my pc, so I can't do that.
    Is there another way to implement the WCF-Servie on the SharePoint and then access this Service with the SilverlightApp ?

    Thanks

  • 20. srpna 2012 12:30
     
     

    Hey,

    You can create a normal WCF service and deploy it as a sub site in the SharePoint server under IIS.

    PS has this been resolved?

    Regards


    I find it distasteful to beg for 'Mark as Answer' and 'Mark as helpful'. It's supposed to be about helping people, not about getting the high score.