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 
    \Windows\Microsoft.Net\Framework\v2.x\Config 
-->
<configuration>
	<appSettings>
		 
	</appSettings>
	<connectionStrings/>
	<system.web>
		<!--
            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">
		</compilation>
		<pages>
			<namespaces>
				<clear/>
				<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"/>
			</namespaces>
		</pages>
		<!--
            The <authentication> section enables configuration 
            of the security authentication mode used by 
            ASP.NET to identify an incoming user. 
        -->
		<authentication mode="Windows"/>
		<authorization>
			<allow roles=".\Administrator"/>
			<allow users="DOMAIN\ServiceAccount"/>
			<deny users="*"/>
		</authorization>

		<!--
            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" />
        </customErrors>
        -->
	</system.web>


	<system.serviceModel>
		
		<bindings>
			<basicHttpBinding>
				<binding name="basicHttpBinding_Windows"> 
					<security mode="TransportCredentialOnly">
						<transport clientCredentialType="Windows" />
					</security>
				</binding>
			</basicHttpBinding>
		</bindings>
		
		<services>
			
			<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 
              automatically.
          -->
					<identity>
						<dns value="localhost"/>
					</identity>
				</endpoint>
				
			</service>
		</services>
		<behaviors>
			<serviceBehaviors>
				
				<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"/>
				</behavior>
			</serviceBehaviors>
		</behaviors>
	</system.serviceModel>
</configuration>

Open in new window

LVL 1
MCLRAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Grant SpiteriSenior 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" />
          </security>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MCLRAuthor Commented:
where do i set the namespace in the wcf service ?
0
Grant SpiteriSenior consultantCommented:
<endpoint address=""   binding="basicHttpBinding" bindingConfiguration="basicHttpBinding_Windows"  contract="Namespace.Layer.IService">
0
MMarlin7Commented:
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.
Thanks.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
WCF

From novice to tech pro — start learning today.