Ese error de metadatos es lo que obtengo cuando navego al servicio en un navegador. No estoy consumirlo con un clienteWCF La publicación de metadatos para este servicio está actualmente deshabilitada + Error de tipo de contenido
y sí .. Me añadieron <serviceMetadata httpGetEnabled="True"/>
, y tengo un punto final definido mex
pero todavía no va a funcionar ..
Así que he creado un servicio de barebones para alojar en IIS7. Instalación nueva de Windows 7 y VS2010.
que habían seguido las instrucciones de esta página a la letra:
http://msdn.microsoft.com/en-us/library/ms733766.aspx
estoy convencido de que esto tiene que haber algún tipo de problema de configuración en IIS 7, pero no seguro. Aquí está mi configuración de servicio:
EDIT:
intenté acceder al servicio con svcutil y obtuve el siguiente error:
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'..
también dice: The HTML document does not contain Web service discovery information.
no está seguro de cómo resolverlo Sin embargo ...
.svc file:
<%@ServiceHost language="C#" Debug="true" Service="DestructionServices.TacticalNukeSVC
"%>
archivo .cs (que se encuentra en el directorio C: \ Desarrollo \ carpeta HostedDestructionServices \ App_Code):
using System;
using System.ServiceModel;
namespace DestructionServices
{
[ServiceContract]
public interface INukeInterface
{
[OperationContract]
string FireMissile();
[OperationContract]
string DirectFire(double x, double y, double z);
[OperationContract]
void EnterCoordinates(double x, double y, double z);
}
public class TacticalNukeSVC : INukeInterface
{
public string FireMissile()
{
return "Boom";
}
public void EnterCoordinates(double x, double y, double z)
{
//bah, who cares about coordinates..
}
public string DirectFire(double x, double y, double z)
{
return "Fired at: " + x + ", " + y + ", " + z;
}
}
}
Web.Config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<services>
<service name="DestructionServices.Destro" behaviorConfiguration="MetadataBehavior">
<endpoint address="" binding="wsHttpBinding" contract="DestructionServices.INukeInterface" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="MetadataBehavior">
<serviceDebug includeExceptionDetailInFaults="True" httpHelpPageEnabled="True" />
<serviceMetadata httpGetEnabled="True"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
También, la adición de un nodo baseAddress es ignorada por IIS – KevinDeus
sí, si aloja en IIS, especificando una dirección base es discutible, ya que IIS dicte dónde vive su servicio ... –