Deploying WCF Service

I am trying to add a reference to the WCF service i created , it works fine inside the network but when i try add it externally i get the following error:

The document at the url http://ipaddress/WCFService/Service.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 'There was an error downloading 'http://localservername/WCFService/Service.svc ?disco'.'.
  - The remote name could not be resolved: 'localservername'
- Report from 'WSDL Document' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.
- Report from 'XML Schema' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.
- Report from http://ipaddress/WCFService/Service.svc' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.
Metadata contains a reference that cannot be resolved: http://ipaddress/WCFService/Service.svc'.
Content Type application/soap+xml; charset=utf-8 was not supported by service http://ipaddress/WCFService/Service.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.

i have included the config file
<?xml version="1.0"?>
    Note: As an alternative to hand editing this file you can use the 
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in 
    machine.config.comments usually located in 
            Set compilation debug="true" to insert debugging 
            symbols into the compiled page. Because this 
            affects performance, set this value to true only 
            during development.

            Visual Basic options:
            Set strict="true" to disallow all data type conversions 
            where data loss can occur. 
            Set explicit="true" to force declaration of all variables.
		<compilation debug="true" strict="false" explicit="true">
				<add namespace="System"/>
				<add namespace="System.Collections"/>
				<add namespace="System.Collections.Specialized"/>
				<add namespace="System.Configuration"/>
				<add namespace="System.Runtime.Serialization"/>
				<add namespace="System.ServiceModel"/>
				<add namespace="System.Text"/>
				<add namespace="System.Text.RegularExpressions"/>
				<add namespace="System.Web"/>
				<add namespace="System.Web.Caching"/>
				<add namespace="System.Web.SessionState"/>
				<add namespace="System.Web.Security"/>
				<add namespace="System.Web.Profile"/>
				<add namespace="System.Web.UI"/>
				<add namespace="System.Web.UI.WebControls"/>
				<add namespace="System.Web.UI.WebControls.WebParts"/>
				<add namespace="System.Web.UI.HtmlControls"/>
            The <authentication> section enables configuration 
            of the security authentication mode used by 
            ASP.NET to identify an incoming user. 
		<authentication mode="Windows"/>
			<allow roles=".\Administrator"/>
			<allow users="DOMAIN\ServiceAccount"/>
			<deny users="*"/>

            The <customErrors> section enables configuration 
            of what to do if/when an unhandled error occurs 
            during the execution of a request. Specifically, 
            it enables developers to configure html error pages 
            to be displayed in place of a error stack trace.

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />

				<binding name="basicHttpBinding_Windows"> 
					<security mode="TransportCredentialOnly">
						<transport clientCredentialType="Windows" />
			<service name="Service" behaviorConfiguration="ServiceBehavior">
				<!-- Service Endpoints -->
				<endpoint address=""   binding="basicHttpBinding" bindingConfiguration="basicHttpBinding_Windows"  contract="IService">
              Upon deployment, the following identity element should be removed or replaced to reflect the 
              identity under which the deployed service runs.  If removed, WCF will infer an appropriate identity 
						<dns value="localhost"/>
				<behavior name="ServiceBehavior">
					<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
					<serviceMetadata httpGetEnabled="true"/>
					<!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
					<serviceDebug includeExceptionDetailInFaults="false"/>

Open in new window

Who is Participating?
Grant SpiteriConnect With a Mentor Senior consultantCommented:
Your end point should include namespace  ie: namespace.layer.IService im not too sure on the settings for TransportCredentialOnly i have only worked with
<security mode="Transport">
            <transport clientCredentialType="Windows" />
            <message clientCredentialType="None" />
MCLRAuthor Commented:
where do i set the namespace in the wcf service ?
Grant SpiteriSenior consultantCommented:
<endpoint address=""   binding="basicHttpBinding" bindingConfiguration="basicHttpBinding_Windows"  contract="Namespace.Layer.IService">
I'm seeing this same error when trying to add a webservice reference to my project. Where is the config file as shown above so i can edit it. My web.config file and the machine config file look much different compared to the one shown above.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.