Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 411191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:57:45+00:00 2026-05-12T17:57:45+00:00

I am writing a Silverlight app calling WCF service. Another solution contains following projects

  • 0

I am writing a Silverlight app calling WCF service.

Another solution contains following projects for Silverlight:
– Web project for hosting silverlight app
– Silverlight app project
– Silverlight class library project with service reference to WCF

When i run the Silverlight app on my locahost, the Silverlight invokes WCF using localhost and works fine.

Then i published the service and web app and deployed it to another server. The web.config file was modified to point to the deployed endpoint address.

Now , running the Silverlight app looks up the localhost url of the service, eventhough the endpoint in web.config is that of the deployed server.

From where does the silverlight app lookup the svc url?
It doesn’t seem to read it from the web.config file. But, seems more like the url was embedded into the assembly during build/publish process.

Any thoughts??

Thanks for reading!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T17:57:46+00:00Added an answer on May 12, 2026 at 5:57 pm

    The silverlight app does NOT look at the web.config of the hosting server at all – that is on the server side and not visible to the silverlight app which is running on the client. The Silverlight app looks in its own ServiceReferences.clientconfig file or at the URL that you specify programmatically when you create the local service proxy in code.

    So, you have 2 options:
    1. Modify ServiceReferences.clientconfig before you build the deployable version of the Silverlight app.
    2. Use code to construct your client-side endpoints with URL’s.

    We use the 2nd option because we like to have a standard programmatic interface that configures our endpoints. We do something like this (but not with the MaxValue’s if it is a public facing service, of course):

    
            public ImportServiceClient CreateImportServiceClient()
            {
                return new ImportServiceClient(GetBinding(), GetServiceEndpoint("ImportService.svc"));
            }
    
            public ExportServiceClient CreateExportServiceClient()
            {
                return new ExportServiceClient(GetBinding(), GetServiceEndpoint("ExportService.svc"));
            }
    
            protected override System.ServiceModel.Channels.Binding GetBinding()
            {
                BasicHttpBinding binding = new BasicHttpBinding(BasicHttpSecurityMode.None);
                binding.MaxBufferSize = int.MaxValue;
                binding.MaxReceivedMessageSize = int.MaxValue;
                binding.SendTimeout = TimeSpan.MaxValue;
                binding.ReceiveTimeout = TimeSpan.MaxValue;
                return binding;
            }
    
            protected EndpointAddress GetServiceEndpoint(string serviceName)
            {
                if (Settings == null)
                {
                    throw new Exception("Service settings not set");
                }
                return
                    new EndpointAddress(ConcatenateUri(Settings.ServiceUri,serviceName));
            }
    
            protected EndpointAddress GetServiceEndpoint(string serviceName, Uri address)
            {
                if (Settings == null)
                {
                    throw new Exception("Service settings not set");
                }
                return new EndpointAddress(ConcatenateUri(address, serviceName));
            }
    

    The classes like “ImportServiceClient” and “ExportServiceClient” are the generated proxies from creating service references to our WCF services. Settings.ServiceUri is where we store the address of the server that we should be talking to (in our case it is set dynamically via parameters to the silverlight plugin in the page it is hosted in, but you could use whatever scheme you like to manage this address).

    But if you prefer to simply tweak ServiceReferences.ClientConfig then you don’t need any code like this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When writing a Silverlight app hooked up to a WCF Web Service, the only
I'm writing a silverlight app that queries a web service to populate a tree
I'm writing a Silverlight app using the MVVM pattern. I have a main view
I'm writing a silverlight application that resembles a shopping cart system. This app can
In a Silverlight application, instead of consuming and writing (wcf) wrappers around messages that
I'm writing a silverlight app which does some real-time charting. Basically, I just have
I have a couple of Accordions in a Silverlight App I'm writing (even an
I am writing an app in Silverlight 3 using the Application Navigation template. So
Hi I am writing a small utility too using silverlight 3 and WCF for
I writing wp7 silverlight app. I have a listbox with items. I want each

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.