Click here to Skip to main content
15,880,608 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Hi,
I want to install WCF on remote host and connect my desktop application to it. I install the WCF but when I try to access the service via browser it says that:
Metadata publishing for this service is currently disabled.

Also I couldn't add service reference to my desktop application.
The HTML document does not contain Web service discovery information.
Metadata contains a reference that cannot be resolved: 'http://xxx.xxx.xxx.xxx./test/test.svc'.
Content Type application/soap+xml; charset=utf-8 was not supported by service http://xxx.xxx.xxx.xxx/test/test.svc.  The client and service bindings may be mismatched.
The remote server returned an error: (415) Cannot process the message because the content type 'application/soap+xml; charset=utf-8' was not the expected type 'text/xml; charset=utf-8'..
If the service is defined in the current solution, try building the solution and adding the service reference again.


Test.cs
C#
namespace TestExample
{
    public class Test: ITest
    {
        ...
    }
}


Test.svc:
<%@ ServiceHost Language="C#" Service="TestExample.Test" %>


App.config:
XML
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.web>
    <compilation debug="true" />
  </system.web>
  <system.serviceModel>
    <services>
      <service name="TestExample.Test">
        <endpoint address="" binding="wsHttpBinding" contract="TestExample.ITest" />
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="http://xxx.xxx.xxx.xxx/test/test.svc" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <serviceMetadata httpGetEnabled="True"/>
          <serviceDebug includeExceptionDetailInFaults="False" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>


What I miss? Any suggestions?

Thank you in advance!

Best regards,
Blagovest Razhenkov
Posted
Updated 17-Aug-12 2:14am
v5
Comments
Abey Thomas 21-Jan-12 22:19pm    
How did you host the WCF service? In the IIS or simply as a command line app or as a windows service?
I suggest you try to access your WCF service using the "wcftestclient" from your desktop.
OPen Visual Studio command prompt (in admin mode) and type "wcftestclient". A client application will open up. See if your WCF service can be accessed through this.
Wael Al Wirr 23-Jan-12 2:17am    
Please can you post the client configuration file content.
darshan_ur 12-Jul-12 9:39am    
on which Server Machine (Operating System/IIS) are you trying to publish the WCF service ?
Kenneth Haugland 22-Jul-12 11:59am    
I think your problem is that It cant find the SVC you have on your web page. I solved it by makeing the directory visible from outside, and it worked...

[Edit]I could run it easily on my computer in debug, but as soon as I published the page with WCF It wouldnt work...[/Edit]

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900