locked
WCF service not processing data when deployed RRS feed

  • Question

  • Hi all,

    I have a silverlight application which captures an image from user's webcam, and then uploads it to the server automatically. Now what happen is the application runs without error on my development server, but when i deployed it to the live server it doesnt work. I can see at IE's status bar that the application is trying to connect to the service, but the service doesn't seem to produce any reply.

    I've tried running the following commands:

    "%WINDIR%\Microsoft.Net\Framework\v4.0.30319\aspnet_regiis" –i –enable
    "%WINDIR%\Microsoft.Net\Framework\v4.0.30319\ServiceModelReg.exe" -r

    also already enabled WCF activation feature in the server.

    Any idea what's going on?

    Monday, October 18, 2010 1:31 AM

Answers

  • I've managed to solved the problem. My SL app is now able to work as what I wanted it to be.

    What is did was just copied the dlls below into the Bin folder:

    • System.ServiceModel.DomainServices.EntityFramework.dll
    • System.ServiceModel.DomainServices.Hosting.dll
    • System.ServiceModel.DomainServices.Server.dll

     Also added the below into web.config under the system.serviceModel tag in the web app

    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true">
                <baseAddressPrefixFilters>
                    <add prefix="http://mydomain.com/" />
                </baseAddressPrefixFilters>
            </serviceHostingEnvironment>

    Also do insert the same domain into the ServiceReferences.ClientConfig under the client endpoint address.
     

     

    Wednesday, October 20, 2010 11:20 PM

All replies

  • Hi,

    1-Change the EndPoints in ServiceReferences.ClientConfig and any where there are Endpoints to <endpoint address="http://localhost/WebService/TestService.svc"

    2-Right Click Project.Web and then select (Publish) :
    a-Publish method :FTP
    b-Target Location :any Folder(X)

    3-When you have Images and ect.. you should all put in ClientBin in your (X) Folder

    4-Configure your IIS >> Add the MIME types Like this >>>
    http://www.longhorncorner.com/UploadFile/nipuntomar/ConfiguringIISSilverlight10022008234540PM/ConfiguringIISSilverlight.aspx

    5-Add your Publish Folder to C:\Inetpub\wwwroot

    6 >>

    1. Open IIS
    2. Expand Sites
    3. Right click on Default Web Page and select "Add New Virtual Directory" option
    4. In the opened pop-up window input "Alias" as Test and populate "Physical path" with C:\Inetpub\wwwroot\TestApp and click "OK"
    5. Right click on the created virtual directory (Test) and select "Convert To Application" option from the content menu.
    6. In the opened pop-up window make sure you have selected by clicking the "Select..." button Classic .NET AppPool in "Application pool". Click "OK".


    7-Copy the clientAccessPolicy.xml and crossDomain.xml to your C:\Inetpub\wwwroot folder.

    a-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 include-subpaths="true" path="/"/>
    </grant-to>
    </policy>
    </cross-domain-access>
    </access-policy>

    b-crossDomain.xml :

    <?xml version="1.0"?>
    <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
    <cross-domain-policy>
    <allow-http-request-headers-from domain="*" headers="*"/>
    </cross-domain-policy>


    8-In your Sql Server , Give IIS Users Permissions to Access your Database.
    Like this Link :
    http://codingresource.blogspot.com/2010/01/login-failed-for-user-nt-authorityiusr.html

    Best Regards

    Ali Derbaj

    Monday, October 18, 2010 5:11 AM
  • Hi Ali,

    Thanks for your reply. I've tried your suggestion, but no luck. Any other possibilities?

    Monday, October 18, 2010 5:42 AM
  • Bump!

    Anybody has any idea what's wrong? Or is there any settings I didn't do?

    Btw, I've have made a sample which is very similiar to my SL app. Download here.

    Tuesday, October 19, 2010 9:37 PM
  • I don't think from what you said that you need a crossdomain or access policy files.

    I would edit the javascript in the hosting page and make sure the last throw error is replaced by a simple Alert(... ) so that it will be sure to show any errors.  I don't know why, but if I don't do that and an unhandled error gets out to the javascript, it doesn't display.

    I think you also need to make sure the IIS server knows about the Silverlight mime types used in the test page.

    Tuesday, October 19, 2010 11:17 PM
  • hi mtiede,

    I've checked and double checked the IIS mime types. Its all in place.

    The weird part is that if I access the .svc file, it shows me "You have created a service". But when my SL app is trying to call the service, it seems like there is no response. I'm not sure if there is problem for the SL app calling the service; or  the service is not responding the the SL app; or other reasons which I don't know about.

    I even tried to copy those System.Web.Ria.* dlls into my Bin folder, but it doesn't seem to help any.

    Tuesday, October 19, 2010 11:37 PM
  • If you are calling the service, then you should have "hooked" the Completed async event.  That event should get called no matter what.  If it fails, then the error code should be in there.  What does the error code show?

    I assume that your service is in the same Asp.net web site/application that contains the page that contains your xap reference.  If it doesn't, then you will have to set up those cross domain / access policy files mentioned earlier.

    If it IS all in one app, then make sure after you have published, that the web.config endpoints don't reference local host, but rather the host on which it is running.  Also make sure the clientconfig that is in the xap ALSO references that same host.

    Most important, check that the completed is being called and what any error codes might be.

    Wednesday, October 20, 2010 6:58 AM
  • Hi,

    Can you check your service whether its working in live server ?

    Like if you try Http://server.com/service.svc

    Are you able to see it working ?

    Wednesday, October 20, 2010 7:05 AM
  • OP said:

    "The weird part is that if I access the .svc file, it shows me "You have created a service"."

    so I think he already did that.

    Wednesday, October 20, 2010 7:30 AM
  • Hi MisterFantastic,

    Yup, I've already done that. It's working in the live server.

    Wednesday, October 20, 2010 11:18 PM
  • I've managed to solved the problem. My SL app is now able to work as what I wanted it to be.

    What is did was just copied the dlls below into the Bin folder:

    • System.ServiceModel.DomainServices.EntityFramework.dll
    • System.ServiceModel.DomainServices.Hosting.dll
    • System.ServiceModel.DomainServices.Server.dll

     Also added the below into web.config under the system.serviceModel tag in the web app

    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true">
                <baseAddressPrefixFilters>
                    <add prefix="http://mydomain.com/" />
                </baseAddressPrefixFilters>
            </serviceHostingEnvironment>

    Also do insert the same domain into the ServiceReferences.ClientConfig under the client endpoint address.
     

     

    Wednesday, October 20, 2010 11:20 PM