Skip to main content

Microsoft Silverlight

Unanswered Question svc file does select items but it doesnt receive in silverlightRSS Feed

(0)

Jelmer850i
Jelmer850i

Member

Member

4 points

99 Posts

svc file does select items but it doesnt receive in silverlight

I've made a function in silverlight:

 

    public partial class MainPage : UserControl
    {
        private string filename;
        private string new_filename;
        private Uploader _uploader = new Uploader(SilverlightUploadApplication.App._BasePath);
        GetMoviesClient proxy = new GetMoviesClient();

        #region Bind        

        private void Bind()
        {
            proxy.getMovieCategoriesCompleted +=
                new EventHandler
                 (proxy_GetCategorieCompleted);
            proxy.getMovieCategoriesAsync();
        }

        void proxy_GetCategorieCompleted(object sender, getMovieCategoriesCompletedEventArgs e)
        {
            drpCategory.ItemsSource = e.Result.ToList();
        }

The meaning is that he goes to my asp.net site, and gets some data.
the function getMovieCategories works, and returns correct data.
But after that i can wait a long time, till i get a timeout.
So the data doesnt received by Silverlight.
Why not? and what can i change?

[ServiceContract(Namespace = "")]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class GetMovies
{
    [OperationContract]
    public void DoWork()
    {
        // Add your operation implementation here
        return;
    }

    // Add more operations here and mark them with [OperationContract]
    [OperationContract]
    public IEnumerable getMovieCategories()
    {
        dfcenterDataContext dbtv = new dfcenterDataContext();
        var query = (from c in dbtv.tblMovieCategories
                     select c);
        return query;
    }

 My clientaccesspolicy.xml:

<?xml version="1.0" encoding="utf-8"?>
<access-policy>
  <cross-domain-access>
    <policy>
      <allow-from http-request-headers="*">
        <domain uri="*"/>
      </allow-from>
      <grant-to>
        <resource path="/" include-subpaths="true"/>
      </grant-to>
    </policy>
  </cross-domain-access>
</access-policy>

And my crossdomein.xml:

<?xml version="1.0" encoding="utf-8"?>
<access-policy>
  <cross-domain-access>
    <policy>
      <allow-from http-request-headers="*">
        <domain uri="*"/>
      </allow-from>
      <grant-to>
        <resource path="/" include-subpaths="true"/>
      </grant-to>
    </policy>
  </cross-domain-access>
</access-policy>

Clientaccesspolicy:

<?xml version="1.0" encoding="utf-8"?>
<access-policy>
  <cross-domain-access>
    <policy>
      <allow-from http-request-headers="*">
        <domain uri="*"/>
      </allow-from>
      <grant-to>
        <resource path="/" include-subpaths="true"/>
      </grant-to>
    </policy>
  </cross-domain-access>
</access-policy>

And my ServiceReferences.ClientConfig file:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.serviceModel>
        <bindings>
            <customBinding>
                <binding name="CustomBinding_GetMovies">
                    <binaryMessageEncoding />
                    <httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
                </binding>
            </customBinding>
        </bindings>
        <client>
            <endpoint address="http://machinename/dftv/GetMovies.svc"
                binding="customBinding" bindingConfiguration="CustomBinding_GetMovies"
                contract="GetMovies" name="CustomBinding_GetMovies" />
        </client>
    </system.serviceModel>
</configuration>

 

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities