Lỗi siêu dữ liệu đó là những gì tôi nhận được khi tôi duyệt đến dịch vụ trong trình duyệt. Tôi không tiêu thụ nó với một khách hàngWCF Xuất bản siêu dữ liệu cho dịch vụ này hiện đang bị vô hiệu hóa + Lỗi loại nội dung
và Yes .. Tôi thêm <serviceMetadata httpGetEnabled="True"/>
, và tôi có một thiết bị đầu cuối mex định nghĩa
nhưng nó vẫn sẽ không làm việc ..
Vì vậy, tôi đã tạo ra một dịch vụ barebones để lưu trữ trên IIS7. Cài đặt mới của Windows 7 và VS2010.
tôi đã theo các hướng dẫn của trang này để bức thư:
http://msdn.microsoft.com/en-us/library/ms733766.aspx
Tôi tin rằng điều này đã được một số loại vấn đề cấu hình với IIS7 nhưng và không chắc chắn. Đây là thiết lập dịch vụ của tôi:
EDIT:
tôi đã cố gắng truy cập vào các dịch vụ với svcutil và đã nhận lỗi sau:
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'..
nó cũng nói: The HTML document does not contain Web service discovery information.
không chắc chắn làm thế nào để giải quyết nó , tuy nhiên ..
.svc tệp:
<%@ServiceHost language="C#" Debug="true" Service="DestructionServices.TacticalNukeSVC
"%>
file .cs (nằm trong thư mục C: \ Development \ HostedDestructionServices \ App_Code thư mục):
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>
cũng có, thêm một nút baseAddress bị bỏ qua bởi IIS – KevinDeus
vâng, nếu bạn lưu trữ trong IIS, xác định một địa chỉ cơ sở là tranh luận, vì IIS sẽ dictate nơi dịch vụ của bạn sống ... –