pdschuller
asked on
Not able to deploy wcf web service from my machine to dev server
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.s vc. I can consume the web service from the Windows project fine.
I want to serve up this web service from our development box at http://123.123.12.1 . (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.Ser vice1"
CodeBehind="Service1.svc.c s"
and copied the following from web.config on my machine to the web.config on the dev box.
<system.serviceModel>
<services>
<service name="wcfHelloWorld.Servic e1"
behaviorConfiguration="wcf HelloWorld .Service1B ehavior">
<endpoint address="" binding="wsHttpBinding" contract="wcfHelloWorld.IS ervice1">
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchang e"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="wcfHelloWorld.Servic e1Behavior ">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFa ults="true "/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
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 http://123.123.12.1/Service1.svc
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="http://123.123.12.1/AppCode" binding="wsHttpBinding" contract="wcfHelloWorld.IS ervice1">
- commented out mex endpoint in IGP6 web.config
<endpoint address="mex" binding="mexHttpBinding"
contract="IMetadataExchang e"/>
- Did <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
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.s
I want to serve up this web service from our development box at http://123.123.12.1 . (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.Ser
CodeBehind="Service1.svc.c
and copied the following from web.config on my machine to the web.config on the dev box.
<system.serviceModel>
<services>
<service name="wcfHelloWorld.Servic
behaviorConfiguration="wcf
<endpoint address="" binding="wsHttpBinding" contract="wcfHelloWorld.IS
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchang
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="wcfHelloWorld.Servic
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFa
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
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 http://123.123.12.1/Service1.svc
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="http://123.123.12.1/AppCode" binding="wsHttpBinding" contract="wcfHelloWorld.IS
- commented out mex endpoint in IGP6 web.config
<endpoint address="mex" binding="mexHttpBinding"
contract="IMetadataExchang
- 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: 'http://123.123.12.1.
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" "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="default.aspx" id="form1">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJNjUxNDcwNzM5ZGT3zyGithsw49HE9tyqIIroGKQcjg==" />
<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWAgL/2Z6dBwKzmeWHCA/WyJT1GsI0d6cFEwzQUXdMTU8h" />
<div>
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>
</div>
</form>
</body>
</html>
'.
If the service is defined in the current solution, try building the solution and adding the service reference again.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
- the error that the wizard throws indicates that it is looking at my default.aspx file, and
- when I try to pull up http://123.123.12.1/Service1.svc in the browser I get an error. Service1.svc has this in it: Service="wcfHelloWorld.Ser
I am attaching the web.config that is on the dev box. Thanks again.
Webconfig.txt