WCF Published service in IIS not working - silverlight

My dev environment is Windows 7 and IIS 7.
i develop a silverlight 4 app that used Silverlight-Enabled WCF service. It is working true in IDE (Visual Studio 2010) but after published it in my IIS 7, service not working true.
clientconfig is true beacause the published service browse is working true.
WCF Service don't fail and does not error.
please help me.
Thanks
mSafdel

First thing to check is to ensure that the Silverlight app is pointing at the production service rather than still at the VS2010 one (ie, localhost:####). There's a few ways to handle this, like generating the WCF service call based on current server your app is coming from, getting the service live on production and updating the service reference to point at the new location, etc.
Another thing to be careful of is that when you move from the VS2010 environment to live you must ensure that your application and service can still access your database. If the user the service is using on IIS doesn't have permission or your connection string hasn't been updated, it sometimes seems like a WCF error (I think it pulls up server error 500 or the fun NotFound) but is actually your service unable to work with the database.
Otherwise, as Marek said more details are always helpful as a lot of things can go wrong in deployment/configuring WCF with Silverlight if you're not careful.

Related

WCF Self hosting

I created a WCF service and hosted that with in a Windows service it is called self hosting. It is clear to me but my question is.
If we are using self hosting in console application/WPF application then do we need to provide WCF code to each installation instance of application. Or will the WCF service be located centrally?
It is absolutely up to you - only application author can make this decision.
If you are creating some kind of client/server application then in most cases you will need to install your client (WPF) application separately from your server (Console + WCF) part.
There are cases, though, when requirements tell you to install them together - again, only you know.
But there is another aspect - hosting WCF service in console host might not be good idea for production code. How are you going to run it? If it is each time when user logins, then what's the purpose of such a service - you can as well keep same code inside WPF application.
If it has to be Windows service, then console app will work, but again you need to think carefully what is the usage scenarios of your product - does it require central server or not.

Siverlight 4 Deployment : WCF RIA Services - “Not Found” Error Message

I have some issues deploying a Silverlight 4 application on a remote server machine. My application consist a Cosmopolitan theme (a master/child page model) that connected with 2 services to retrieve specific information.
The first service is pretty simple. It is an asmx service that sends back the User Logon name to the Silverlight application.
The second one is a LinqToSQL service that relay some information to some autocompletebox and search tool.
I have developed the application on my machine using a local SQL server. When I am testing locally with an address type like this one (http://localhost:4080), it is working perfectly. But when deploying on the server using the domain name, it is giving the error saying that the remote server returned an error: NotFound.
I followed and review every steps on of deployment but I still have a problem. I try by all means to find a solution to this problem. Of course go through the list of prerequisites provided on these sites:
http://msdn.microsoft.com/en-us/library/ff426912%28v=vs.91%29.aspx
First, I tried myself to deploy the application without having to disturb my network administrators that by installing the required dll’s in the Bin directory of my project. I have installed those 3 dll’s (System.ServiceModel.DomainServices.Server.dll, System.ServiceModel.DomainServices.Hosting.dll and Microsoft.ServiceModel.DomainServices.LinqToSql.dll). Of course, nothing worked.
I then ask the network administrator to install the WCF RIA services. Does he have to configure something other than installing the WCF RIA services? Is this service including the Microsoft.ServiceModel.DomainServices.LinqToSql.dll.
I suspect that my problem comes from a configurations file: ServiceReferences.ClientConfig or Web.config. But I have included the exact same information from the MSDN site of deployment so I do not see where my problem might be. Am I using the wrong technique to publish the project? I am publishing the site using the File System method and then after modifying the config file to point to the right domain name.
I am able to reach the services by typing the http://domainname/ MeritService1.svc. It is telling me that I can test with the svcutil.exe or slsvcutil.exe. Will I lose a lot of time testing this?
By the way, Fiddler does not give much information accept a 500 error code.
It seems that many developers have the same problem themselves but I do not know where to aim! Anybody have a clue?
Here are the specs:
Local machine: Windows XP,
Browser: IE8 with Silverlight
Server Machine: Windows 2003 with IIS 6, .NET 4.0 and WFC RIA installed.
The following link may be of some help
WCF RIA Services - “Not Found” Error Message

Website hostoed on IIS 7 displays zero results from stored procedure query

I have a WCF REST service running on IIS on port 8000. I have implemented two GET methods in the service. I created another web application project to implement the UI for the GET's. This application is also hosted on the same IIS on port 8080.
The GET methods call a stored proc from a SQL server db, also hosted on the same machine as IIS (this is a prototype).
From my VS 2010 environment, I am able to display the results from the db on the UI (using GridView and ObjectDatasource as the GET methods from the referenced WCF project). However, when both projects are hosted on IIS on different ports, the UI shows the column headers but not the results. I have checked the connection string for the projects and dont see an issue there.
Any suggestions?
First, I know you say you have checked it, but make sure you check the connection strings in the actual IIS directories. If they have been edited, publishing your site may no overwrite them.
Filing that, you may wish to attach to the IIS process to see what is going on. See How to debug a deployed web site.

Silverlight client never calls WCF Service

This one has me completed stumped. I have developed a silverlight application that calls back to WCF services ( it's a silverlight - basicHttpBinding)
The site works perfectly fine from my development machine, but when it is deployed to the developement server. The application is delivered with the XAP just fine, but it never attempts to talk to the service. I have a service call in the bootstrapper so it should be calling this when the client starts up. The services are healthy. They can be browsed to and show the standard WCF service display. We have been through the bindings many times and everything seems to be ok. I have added an extensive amount of error handling for displaying any errors, but on this dev server, no service calls and no errors are being raised.
Fiddler shows the page being loaded up, but my client never issues a call to the service. The service is in the same folder as the default.aspx which hosts the Silverlight client.
This is a Silverlight 3.0 app.
Anybody ever seen anything similar?
I will try to debug in three steps
Verify whether the hosted service on dev server is up or not, by hitting the service URL from your browser on your dev machine.
Make sure that ServiceReferences.ClientConfig consists ur hosted service URL and not dev machine service URL.
If still error occurs try to debug your application from visual studio by pointing the endpoint address to http://urserver/urservicename.svc
Also make sure you dont have have cross domain problems by using "silverlight spy" tool
Put a graphical display like "I made the call!" before the service invocation. just to be sure that your app is really trying to call the service...
So we could narrow the search to a communication problem. : )
Verify that there aren't any cross-domain rules stopping the app to make the call.
by the way, are you calling a WCF service from another domain?
Are you sure the silverlight app is loading at all? If you are making the service call in the boot strapper and the call breaks, I assume that will lead to just a blank page. If you are seeing just a blank page, then perhaps there is something wrong with the .xap mime type issued from the server. Here is some more info on that:
http://learn.iis.net/page.aspx/262/configuring-iis-for-silverlight-applications/

Deploying a Silverlight Application with built-in ASMX WebService to IIS

I've got a Silverlight application which uses a built-in .ASMX WebService to access a SQL database and run some queries. Everything runs without any hitches on my Development machine.
I'm trying to deploy the application to IIS 6 and I'm having some issues.
The Silverlight application itself seems to run fine, however the Web Service does not. I get an unhandled exception error that says [Async_ExceptionOcurred] as soon as the page loads (when the page loads I'm making some Async WebService method calls).
I think this is an issue with the Web Service but I don't know what the problem is. I tried setting the WebService namespace to my URL, but that didn't work. I've tried messing with the SQL connection string in my Web Config but that also affects nothing.
One thing to note is that my IIS Virtual Directory only contains my SilverlightApp.Web folder. I know that the other folder that's part of the application contains a .ClientSettings file for the WebService, but I think this is embedded into the .xap.
Can anyone shed any light on this?
The most likely thing that's happening:
Your webservice proxy on the client is using the address of the web service it was built against: ("http://localhost...").
Things to do:
Use fiddler to confirm this is the issue. It will show you where the proxy is making the call to.
Use the overloaded constructor for the web service and specify a URI. Consider using id/deffing for debug/release. This will overwrite the settings in the client.config.
Create another endpoint in the client config for the release build (Shawn's article here) and select one or the other (again using if/defs).
There are other options as well (looking at the URI and building up the service adress)... but that's the general idea.
hth,
Erik

Resources