Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more


Not able to deploy wcf web service from my machine to dev server

Posted on 2009-05-19
Medium Priority
Last Modified: 2012-05-07
I have created a wcf web site project in Visual Studio 2008 and a Windows project that consumes that web service on my machine.   I want to serve this web service from our development box but get an error when I try to create a Service Reference to that from my Windows project consumer.
The project that works in on my machine.  I had added a Service Reference to the Windows project called wcfHelloMay18.   When I r-click the Service References/wcfHelloMay18 and look at configure the Address that is displayed is http :// localhost:60593/Service1.svc.  I can consume the web service from the Windows project fine.
I want to serve up this web service from our development box  at .  (The website at this address serves up just fine)   But I keep getting the error that I put here in the code window.

Here is what I did in order to try to get the web service to serve from the dev box:    I copied the files from my machine to the root dev box website   (when I had the files in an App_Code dir , I got a Forbidden error when trying to Add Service Reference from the Windows app.)
      IService1.cs,   Service1.svc,   Service1.svc.cs
      The Service1.svc file has this in it.
            ServiceHost Language="C#"
            Debug="true" Service="wcfHelloWorld.Service1"
and copied the following from web.config on my machine to the web.config on the dev box.
            <service name="wcfHelloWorld.Service1"  

<endpoint address="" binding="wsHttpBinding" contract="wcfHelloWorld.IService1">
              <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
              <behavior name="wcfHelloWorld.Service1Behavior">
                <serviceMetadata httpGetEnabled="true"/>
                <serviceDebug includeExceptionDetailInFaults="true"/>
Thank you in advance for your advice on what I should do so that I can create a Service Reference to the web service on the dev box.
Here are some things I tried.
      - I tried to IE to
            Error:  The type 'wcfHelloWorld.Service1', provided as the Service attribute value in the ServiceHost directive could not be found.
      - I moved the files out of the App_Code dir and deleted the dir
      - added an address to endpoint in IGP6 web.config like this
         <endpoint address="" binding="wsHttpBinding" contract="wcfHelloWorld.IService1">
                              - commented out mex endpoint in IGP6 web.config
            <endpoint address="mex" binding="mexHttpBinding"

- Did   <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
       <serviceMetadata httpGetEnabled="true"/>
The Error:
The HTML document does not contain Web service discovery information.
Metadata contains a reference that cannot be resolved: '
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 819 bytes of the response were: '
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="" >
<form name="form1" method="post" action="default.aspx" id="form1">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJNjUxNDcwNzM5ZGT3zyGithsw49HE9tyqIIroGKQcjg==" />
<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWAgL/2Z6dBwKzmeWHCA/WyJT1GsI0d6cFEwzQUXdMTU8h" />
this is default.asp on IGP6, the pdsDemo website
<br /><br /><br />
<input type="submit" name="cmd1" value="cmd1" id="cmd1" />
<br /><br /><br />
<span id="Label1">Label</span>
If the service is defined in the current solution, try building the solution and adding the service reference again.

Open in new window

Question by:pdschuller
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Author Comment

ID: 24424788
I think this boils down to the Visual Studio 2008 web service discovery wizard not being able to find the web service on the dev box.  Because:
   -  the error that the wizard throws indicates that it is looking at my default.aspx file, and
   -  when I try to pull up  in the browser I get an error.  Service1.svc has this in it: Service="wcfHelloWorld.Service1"   The error says: The type 'wcfHelloWorld.Service1', provided as the Service attribute value in the ServiceHost directive could not be found.

I am attaching the web.config that is on the dev box.  Thanks again.

Accepted Solution

pdschuller earned 0 total points
ID: 24453404
There were two problems
 1.) the dll that my web service project created had to be dragged over to the bin directory of the web-site-to-which-I-was-deploying.  (The reason I hadnt done this was that "Microsoft .NET Framework 3.5 - Windows Communication Foundation" (p.106) had said that was optional.
 2.) when it came time to create a Service Reference in the VS 2008 I was using the IP number like   and I needed to use
btw, I got that correct url when I browsed to  The IP worked in that case.

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In previous Articles, we have discussed how we can upload a file using .asmx web service and isolated storage space. Here, in continuation to the topic, I am going to discuss how we can use WCF for the same purpose. Steps: 1.Create the silverli…
While working on Silverlight and WCF application, I faced one issue where fault exception occurred at WCF operation contract is not getting propagated to Silverlight client. So after searching net I came to know that it was behavior by default for s…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…

647 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question