Service Reference in VS2010 not working

Service Reference in VS2010 not working

Old forum URL: forums.lhotka.net/forums/t/8798.aspx


Jav posted on Tuesday, April 13, 2010

Just started to use VS2010.   Opened my SL 3.8.2 project.  Everything appears to have converted fine but the ServiceReferences are behaving badly.

The WcfPortal.svc file contains:

<%@

 

ServiceHost Service="Csla.Server.Hosts.Silverlight.WcfPortal" %>

The WebConfig is also unchanged from VS2008 file where everything was working for months now.  When I try to create a ServiceReference from a .Client project, clicking the Discover button does bring up the WcfPortal, but when I click OK, I get the following error:

There was an error downloading metadata from the address. Please verify that you have entered a valid address.
No service metadata was found at the address specified in the Address field. Verify that the URL address was entered correctly and that there are no connectivity issues.

If, instead of clicking OK in that dialog, I click WcfPortal.svc entry, I get an error which provides the following detail:

The HTML document does not contain Web service discovery information.
Metadata contains a reference that cannot be resolved: 'http://localhost/EMSilverlight.Web/WcfPortal.svc'.
The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: '

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head><title>

</title></head>
<body>
    <form name="form1" method="post" action="Login.aspx?ReturnUrl=%2fEMSilverlight.Web%2fWcfPortal.svc" id="form1">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMTQzMzQ5NDg2OQ9kFgICAw9kFgICAQ9kFgJmD2QWAgINDxAPFgIeB0NoZWNrZWRnZGRkZBgBBR5fX0NvbnRyb2xzUmVxdWlyZVBvc3RCYWNrS2V5X18WAQURTG9naW4xJFJlbWVtYmVyTWXh6KQQCFv8nPS87xkmfpERnLYEug==" />

<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWBQLMyMPnBAKUvNa1DwL666vYDAKC0q+kBgKnz4ybCLpSppbUz4zQFzw/9wX7/JcdUQBA" />
    <div>
   
        <table align="center" style="width: 100%; height: 651px">
            <tr>
                <td align="center" style="height: 30%">
                    <strong><span style="font-size: 36pt">
                    <span style="font-family: Edwardian Script I'.
If the service is defined in the current solution, try building the solution and adding the service reference again.

Jav

RockfordLhotka replied on Tuesday, April 13, 2010

http://www.lhotka.net/weblog/RunningCSLANET382UnderNET4AndSilverlight4.aspx

 

Jav replied on Tuesday, April 13, 2010

I am still using Silverlight 3 and Framework 3.5

After posting that message, I simply re-copied the ServerReferences.ClientConfig file into every project that needed it.  I was also going back and forth between VS2008 and 2010 while trying to see where the problem might be, but somehow, I can now run the application and it is working.  Whether recopying those files did anything, I don't know  (those files were there in the first place). 

The error I reported in my post occured when I try to set up the server reference, and it still occures.  Since the program runs fine, I haven't done anything else.

Jav

Copyright (c) Marimer LLC