我使用Microsoft WF(https://msdn.microsoft.com/en-us/library/ff432975%28v=vs.110%29.aspx)
创建了一个Workflow服务当我在visual studio中运行该服务时,我收到以下错误
Error: Cannot obtain Metadata from http://localhost/OrderService/Service1.xamlx
如果这是您有权访问的Windows(R)Communication Foundation服务,请检查您是否已在指定地址启用元数据发布。 有关启用元数据发布的帮助,请参阅http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange错误URI上的MSDN文档:http://localhost/OrderService/Service1.xamlx 元数据包含无法解析的引用:“http://localhost/OrderService/Service1.xamlx”。 服务器没有提供有意义的回复;这可能是由于合同不匹配,过早的会话关闭或内部服务器错误引起的.HTTP GET错误URI:http://localhost/OrderService/Service1.xamlx 下载“http://localhost/OrderService/Service1.xamlx”时出错。请求因空响应而失败。
我的配置如下。我也在配置文件中添加了Meta Exchange行。
<system.serviceModel>
<services>
<service behaviorConfiguration="metadataBehavior" name="MyService">
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="metadataBehavior">
<!-- To avoid disclosing metadata information, set the values below to false 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="true"/>
<!--Connection String for the WF SQL Presistance-->
<sqlWorkflowInstanceStore connectionString="Data Source=AAAAA;Initial Catalog=KK_SQLPersistenceStore;Asynchronous Processing=True" instanceEncodingOption="None" instanceCompletionAction="DeleteAll" instanceLockedExceptionAction="BasicRetry" hostLockRenewalPeriod="00:00:30" runnableInstancesDetectionPeriod="00:00:02" />
<workflowIdle timeToUnload="0"/>
</behavior>
</serviceBehaviors>
</behaviors>
答案 0 :(得分:1)
尝试将您的端点地址更改为此
<endpoint address="http://localhost/OrderService/Service1.xamlx/mex" binding="mexHttpBinding" contract="IMetadataExchange" />