none
IIS 5.1 and WCF Service -> Step by Step

    Question

  • Hello there,

    and again: I have no clue to make the next (last) step! I found some posts and some help via google, but in the end nothing that helped me to solve...

    I have a Silverlight Application with data from a Sql-Server via WCF-Service. Its working just the way we want it to work in  vs2010.

    Now I want to put the app on our local intranet-server (IIS 5.1). Everything I found on google did not help me to come to an end.

    When I now call the webservice I get a Inner Exception - I now have had at least 3 different types of Exeptions.

    There was nothiong that really helpes. Changing endpoint, publishing via VS 2010, publishing the webservice first...

    Is there any step-by-step tutorial or something that could help me?

    Thank you!

     

     

    Tuesday, December 21, 2010 10:05 AM

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

    Tuesday, December 21, 2010 10:06 AM
  • check this link too >>

    http://dotnetefectivecoding.blogspot.com/2009/08/publish-silverlight-3-on-iis-70-75.html


    i hope to help you ...

    Tuesday, December 21, 2010 10:10 AM
  • http://www.longhorncorner.com/UploadFile/nipuntomar/ConfiguringIISSilverlight10022008234540PM/ConfiguringIISSilverlight.aspx

    Tuesday, December 21, 2010 10:12 AM
  • Hello,

    thank you for your help. I am testing with a WCF-Service without a Database now.

    I tried to follow your instruction but in the end i got an error! Maybe I can ask you some specific questions:

    1. Change the endpoints: what do you mean by anywhere? I changed this in ServiceReferences.ClientConfig where else?

    2. "Convert to application" -> unfortunatley we have IIS5.1 and there is no option on right click.

    Thank you!

     

    Während des Vorgangs ist eine Ausnahme aufgetreten, sodass das Ergebnis ungültig ist. Weitere Ausnahmedetails finden Sie in InnerException.
    
       bei System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
       bei SilverlightApplication1.ServiceReference1.getTestCompletedEventArgs.get_Result()
       bei SilverlightApplication1.Home.client_getTestCompleted(Object sender, getTestCompletedEventArgs e)
       bei SilverlightApplication1.ServiceReference1.Service1Client.OngetTestCompleted(Object state)


     

     

     

    Tuesday, December 21, 2010 10:40 AM
  • OK- we are going to change our server (and our iis).

    We will see what is the next problem Yell

    Wednesday, December 22, 2010 4:24 AM
  • Hi,

    I mean when you declared endpoints in your C# code, you musst it change to the new Endpoint ...

    I have not very big Experience with IIS , i have IIS 7 ...


    Ali Derbaj

    Thursday, December 23, 2010 4:30 AM
  • did you read that :

    Preparing IIS Environment

    After you built your Silverlight application you're probably about to publish it on IIS.

    First of all, check the IIS in the Windows Features (e.g. on Windows Vista/7, navigate to Control Panel - Programs and open Turn Windows Features On Or Off). Make sure you have checked the following options:

    • Internet Information Services (recommend all features except FTP if you don't use it)
    • Microsoft .NET Framework 3.5.1 (recommend all features)

    If you already have installed the IIS, you can start it (IIS Manager), it can be found in Control Panel - Administrative Tools in Vista or Control Panel - System And Security - Administrative Tools in Windows 7 as Internet Information Services (IIS) Manager.

    Adding your Silverlight application

    In IIS Manager, right click on your Default Web Page, located under Sites, and Add New Virtual Directory.
    In the opened window (Add Virtual Directory) input Alias name and browse for Physical path. You can also specify a user whos credentials will be used to open a web site by clicking on Connect as.... If you're happy with your settings click OK. You have successfully created the virtual directory where your applications resists.

    Now, you have to convert this virtual directory to application. To do this, just right click on it and select "Convert To Application" option from the content menu. The application pool should be "Classic .NET AppPool". To set it up click the "Select" button and choose "Classic .NET AppPool" from the drop-down. After then, click "OK" and your website is published on the IIS.

    Please follow this simplified example to setup web application in IIS for a project that's been build in C:\Inetpub\wwwroot\TestApp
    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".

    That's all. Right now, you can check your website. Right click on the created application (Test) select "Manage Application" - "Browse" from the content menu. This will open your website on your default browser.
    Right now, your website is also accessible by typing the http://localhost/Test on the browser's URL.

    Thursday, December 23, 2010 4:33 AM
  • Hello again,

    thanks for your help so far! We have a Windows Server 2003 and i can find the test application in our intranet with

    http://172.18.1.226/SilverlightApplication1TestPage.html! But when I call  WCF-Webservice via Button I get an error!

    bei System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
    bei SilverlightApplication1.ServiceReference1.testCompletedEventArgs.get_Result()
    bei SilverlightApplication1.About.client_testCompleted(Object sender, testCompletedEventArgs e)
    bei SilverlightApplication1.ServiceReference1.Service1Client.OntestCompleted(Object state) 

    I changed the endpoint in the ServiceReference.ClientConfig like

    <configuration>
        <system.serviceModel>
            <bindings>
                <basicHttpBinding>
                    <binding name="BasicHttpBinding_IService1" maxBufferSize="2147483647"
                        maxReceivedMessageSize="2147483647">
                        <security mode="None" />
                    </binding>
                </basicHttpBinding>
            </bindings>
            <client>
                <endpoint address="http://172.18.1.226/Service1.svc" binding="basicHttpBinding"
                    bindingConfiguration="BasicHttpBinding_IService1" contract="ServiceReference1.IService1"
                    name="BasicHttpBinding_IService1" />
            </client>
        </system.serviceModel>
    </configuration>

    So is this the wrong location for the Service1.svc? In the xap file are no directories... 

    Do I have to add a MimeType for the .svc (how?)?

    Thanks for your help again!

    Thursday, January 06, 2011 2:51 AM