元数据包含指定名称空间时无法解析的引用

时间:2017-10-06 02:24:42

标签: .net vb.net wcf

我在服务和客户端共享的项目中有一个Class2和一个Class1。

colour

这是我的服务界面:

geom_line

在我的服务项目中,我还有一个继承自共享类的Class1:

ggplot2

我的服务配置:

ggplot(gantt) +
  geom_segment(aes(x=dummy.start.time, xend=dummy.end.time, y=weekday, yend=weekday, colour=asset.type), size=10) +
  scale_colour_manual("Asset Type", values=c("dodger blue", "black")) +  
  theme_bw() +
  theme(axis.title = element_blank())

  

当我尝试在客户端项目中添加服务引用时,出现错误:

无法识别URI前缀。 元数据包含无法解析的引用:' net.tcp:// localhost / service / mex'。 元数据包含无法解析的引用:' net.tcp:// localhost / service / mex'。 如果在当前解决方案中定义了服务,请尝试构建解决方案并再次添加服务引用。

如果我从服务项目中Class1的DataContract属性中删除命名空间,那么我就可以生成服务引用。但是我不得不添加这个命名空间并删除它会破坏其他东西。如何在保留命名空间的同时生成服务引用?

如果我在共享和服务项目中将命名空间更改为net.tcp而不是http,这也有效,但这对我来说不是一个很好的解决方案,因为我不想重建现有的客户端。

1 个答案:

答案 0 :(得分:0)

您的配置中缺少一些细节。

netTcpBinding没有任何地址端点

baseaddress没有指定任何端口。 如果您不使用任何端口80将默认仅用于http.Its总是更好地克服nettcp架构的http.Incase的默认值,您必须明确定义端口。

 <service behaviorConfiguration="MyServ" name="WcfService1.Service">
    <endpoint address=""  binding="netTcpBinding" bindingConfiguration="" contract="WcfService1.IService" />
    <endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
      contract="IMetadataExchange" />
    <host>
      <baseAddresses>
        <add baseAddress="net.tcp://localhost:8080/service/" />
      </baseAddresses>
    </host>
  </service>

现在您可以通过此地址添加服务引用net.tcp:// localhost:8080 / service /

相关问题