locked
WFC Service Application using IIS Error RRS feed

  • Question

  • Having an issue getting my SL application to use my WFC Service.

    I have one solution, the SL application is in it, with the Web App, and a page that hosts the SL application. This Web App is running on the computer's 6.0 IIS as http://localhost/tps/     tps is a virtual directory under the IIS root. I did this to simulate my project on a live IIS server and not just in Visual Studio's Web Dev server. This is on Windows XP x64 Pro. 

    I want the SL application to get some data from my data base, so I read I need to create a WFC Service Application to use as a bridge. I added the WFC app to my solution, and it defaults to use VS Dev Server, auto-assign port, Virtual Path /    But I want it to run on my IIS Web Server, so I flip the radio button, and it already had http://localhost/WcfService1 typed in. I typed in http://localhost/tps/WfcService1 instead so it will run under my tps project site. I hit Create Virtual Directory, and I can see this Directory in IIS

    Next step I read is to add the service reference to the SL app (and here comes the problem!). I hit the Discover button and it finds my service, showing tps/WfcService1/Service1.svc, I select this and hit OK, here is the strange error:

    There was an error downloading metadata from the address. Please verify that you have entered a valid address.

    I hit details and found this block of errors:

    The document at the url http://localhost/tps/WcfService1/Service1.svc was not recognized as a known document type.
    The error message from each known type may help you fix the problem:
    - Report from 'DISCO Document' is 'Name cannot begin with the '%' character, hexadecimal value 0x25. Line 1, position 2.'.
    - Report from 'WSDL Document' is 'There is an error in XML document (1, 2).'.
      - Name cannot begin with the '%' character, hexadecimal value 0x25. Line 1, position 2.
    - Report from 'XML Schema' is 'Name cannot begin with the '%' character, hexadecimal value 0x25. Line 1, position 2.'.
    Metadata contains a reference that cannot be resolved: 'http://localhost/tps/WcfService1/Service1.svc'.
    The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate,NTLM'.
    The remote server returned an error: (401) Unauthorized.
    If the service is defined in the current solution, try building the solution and adding the service reference again.

     

    When I type the URL in the browser to get to the .svc file, the page errors and shows this:

     

    The XML page cannot be displayed

    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.


    A name was started with an invalid character. Error processing resource 'http://localhost/tps/PathService/Service1.svc'. L...

    <%@ ServiceHost Language="C#" Debug="true" Service="PathDataService.Service1" CodeBehind="Service1.svc.cs" %>
    -^

    Any ideas? Thanks.

    Thursday, May 22, 2008 3:09 PM

Answers

  • I did several things and now I'm not sure which fixed the issue.

    I ran many commands on the aspnet_regiis.exe   somehow I had two versions of .net 2.0 running on IIS that I found with the -lv switch. One version was in the ... /Framework/... folder and the other was in the .../Framework64/... folder.

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=526942&SiteID=1

    So I removed all versions by -ua switch, then I did -i switch to install the 64-bit version of 2.0. Now -lv only shows the one .NET running on IIS.

    I then read that it helps to remove the svc file extension out of ISAPI mappings from IIS, then re-add the value. 

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2594537&SiteID=1

    Once I did those things, I tryed the svc page in IE, I got some compatibility error. I read that to fix that I need to change the web.config line

    <serviceHostingEnvironment aspNetCompatibilityEnabled="false" />

    from True to False as I have it now. Now I can see the svc file in IE!

    Friday, May 23, 2008 9:32 AM
  • Maybe the problem is you installed WCF before IIS. You can have a try to re-register the WCF .
    Wednesday, July 22, 2009 9:23 PM

All replies

  • (Sorry about the triple posting this thread last night)

    I tryed a few more things:

    I left the IIS prompt as Visual Studio defaulted to which is http://localhost/WcfService/ instead of placing it under my TPS directory.. same result as above.

    When I leave the option as Use VS Development Server and it picks some random port http://localhost:1234/WcfService/  - I can get past the error above, but then I get cross-domain errors.. but I don't want to pursue this solution to my problem because I want everything to run on the same server.

    So still lost as of this morning! Thanks.

    Friday, May 23, 2008 7:55 AM
  • This might be a problem outside of Silverlight.. I installed IIS after I had all .NET framework and VS 2008 on my computer. After I installed IIS, I removed all framework versions, and installed them fresh. Note I am on XP 64 running IIS 6.0. I am seaching more on this on WCF forums, but if anyone has some insight I'm all ears. I'll post what I find.

    Friday, May 23, 2008 8:34 AM
  • I did several things and now I'm not sure which fixed the issue.

    I ran many commands on the aspnet_regiis.exe   somehow I had two versions of .net 2.0 running on IIS that I found with the -lv switch. One version was in the ... /Framework/... folder and the other was in the .../Framework64/... folder.

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=526942&SiteID=1

    So I removed all versions by -ua switch, then I did -i switch to install the 64-bit version of 2.0. Now -lv only shows the one .NET running on IIS.

    I then read that it helps to remove the svc file extension out of ISAPI mappings from IIS, then re-add the value. 

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2594537&SiteID=1

    Once I did those things, I tryed the svc page in IE, I got some compatibility error. I read that to fix that I need to change the web.config line

    <serviceHostingEnvironment aspNetCompatibilityEnabled="false" />

    from True to False as I have it now. Now I can see the svc file in IE!

    Friday, May 23, 2008 9:32 AM
  • Maybe the problem is you installed WCF before IIS. You can have a try to re-register the WCF .
    Wednesday, July 22, 2009 9:23 PM
  • This link will be useful http://msdn.microsoft.com/en-us/library/ms752252.aspx
    Wednesday, July 22, 2009 9:37 PM