我收到错误:
Cannot obtain Metadata from http://localhost:8733/SolutionName/Service....
...There was an error downloading 'http://localhost:8733/SolutionName/Service'.
The request failed with HTTP status 404: Not Found.
奇怪的是,我在今天早些时候通过WCFTestClient进行连接,然后对Service
和IService
文件进行了任何更改。
我有一个基本服务(自托管),用于测试使用以下配置的修改:
<service name="SolutionName.Service">
<endpoint address="" binding="basicHttpBinding" contract="SolutionName.IService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8733/SolutionName/Service" />
</baseAddresses>
</host>
</service>
....
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="True" httpsGetEnabled="True"/>
<serviceDebug includeExceptionDetailInFaults="False" />
</behavior>
</serviceBehaviors>
我有httpGetEnabled="True"
喜欢它,但它仍然无法连接。我已经尝试删除输出目录中的所有内容,但问题仍然存在。
编辑 -
这是IService
。新方法标有//NEW
[ServiceContract]
public interface IService
{
#region SupportItems
[OperationContract]
PipkinEvent[] GetPipkinEvents();
[OperationContract]
PipkinEventType[] GetPipkinEventTypes();
[OperationContract]
PipkinEventTypeGroup[] GetPipkinEventTypeGroups();
[OperationContract]
PipkinTaskCategory[] GetPipkinTaskCategories();
[OperationContract]
PipkinDepartment[] GetPipkinDepartment(); //NEW
[OperationContract]
PipkinOffice[] GetPipkinOffice(); //NEW
[OperationContract]
PipkinJobClassification[] GetPipkinJobClassification(); //NEW
#endregion
#region InformationItems
[OperationContract]
PipkinStaff[] GetPipkinStaff();
[OperationContract]
PipkinPFUser[] GetPipkinPFUsers();
[OperationContract]
PipkinTask[] GetPipkinTasks(DateTime startDate, DateTime endDate);
[OperationContract]
PipkinStaffOffice[] GetPipkinStaffOffice(); //NEW
[OperationContract(Name = "GetPipkinStaffOfficeAsOf")]
PipkinStaffOffice[] GetPipkinStaffOffice(DateTime enteredDate); //NEW
[OperationContract]
PipkinStaffDepartment[] GetPipkinStaffDepartment(); //NEW
[OperationContract(Name = "GetPipkinStaffDepartmentAsOf")]
PipkinStaffDepartment[] GetPipkinStaffDepartment(DateTime enteredDate); //NEW
[OperationContract]
PipkinStaffClassification[] GetPipkinStaffClassification(); //NEW
[OperationContract(Name = "GetPipkinStaffClassificationAsOf")]
PipkinStaffClassification[] GetPipkinStaffClassification(DateTime enteredDate); //NEW
#endregion
}