WCF 服务基地址 Http 和 netTcp

2024-05-01

我的 WCF 服务配置文件中定义了两个基址:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>      
  <system.diagnostics>
    <sources>
      <source name="System.ServiceModel" switchValue="Warning, ActivityTracing"
        propagateActivity="true">
        <listeners>
          <add type="System.Diagnostics.DefaultTraceListener" name="Default">
            <filter type="" />
          </add>
          <add name="ServiceModelTraceListener">
            <filter type="" />
          </add>
        </listeners>
      </source>
    </sources>
    <sharedListeners>
      <add initializeData="C:\WCF Service Logs\app_tracelog.svclog"
        type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
        name="ServiceModelTraceListener" traceOutputOptions="DateTime, Timestamp">
        <filter type="" />
      </add>
    </sharedListeners>
  </system.diagnostics>
  <system.serviceModel>
    <bindings>
      <netTcpBinding>
        <binding name="netTcp" maxBufferPoolSize="50000000" maxReceivedMessageSize="50000000">
          <readerQuotas maxDepth="500" maxStringContentLength="50000000" maxArrayLength="50000000" maxBytesPerRead="50000000" maxNameTableCharCount="50000000" />
          <security mode="None"></security>
        </binding>
      </netTcpBinding>
    </bindings>
    <services>
      <service behaviorConfiguration="ReportingComponentLibrary.TemplateServiceBehavior"
        name="ReportingComponentLibrary.TemplateReportService">
        <endpoint address="TemplateService" binding="netTcpBinding" bindingConfiguration="netTcp"
          contract="ReportingComponentLibrary.ITemplateService"></endpoint>
        <endpoint address="ReportService" binding="netTcpBinding" bindingConfiguration="netTcp"
          contract="ReportingComponentLibrary.IReportService"/>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="net.tcp://localhost:8001/TemplateReportService" />
            <add baseAddress="http://localhost:8181/TemplateReportService"  />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="ReportingComponentLibrary.TemplateServiceBehavior">
          <serviceMetadata httpGetEnabled="True"/>
          <serviceDebug includeExceptionDetailInFaults="True" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>

尽管我已将端点绑定设置为 netTcpBinding,
我只能使用基地址访问我的 WCF 服务:

http://localhost:8181/TemplateReportService

并且不与

net.tcp://localhost:8001/TemplateReportService

如何使用 netTcp 地址访问我的服务?


您将 Net.TCP 基地址定义为:

net.tcp://localhost:8001/TemplateReportService

您的 Net TCP 端点是:

<endpoint address="TemplateService" 

and

<endpoint address="ReportService" 

所以他们完整的服务地址将是“netTcp基地址”+“相对地址”<endpoint>元素” - 这给出:

net.tcp://localhost:8001/TemplateReportService/TemplateService

and

net.tcp://localhost:8001/TemplateReportService/ReportService

尊敬。

您可以在这些地址使用它们吗?

另外 - 您为 HTTP 协议定义了一个“mex”(元数据交换)端点 - 这就是为什么您在导航到 HTTP 地址时可以看到某些内容。但您没有为 netTcp 指定 MEX 端点。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

WCF 服务基地址 Http 和 netTcp 的相关文章

随机推荐

  • Android SQLite 通配符

    我正在尝试使用通配符元素进行查询 以在 SQLite 表中搜索特定变量中任意位置具有元素的条目 public String getCheckoutEntry String title String ISBN Wild card Syntax
  • 在哪里可以找到 Fluent NHibernate 教程?

    我用谷歌搜索并环顾四周 是否有人知道任何隐藏的宝石不在谷歌搜索的前几页中 The wiki https github com jagregory fluent nhibernate wiki 是你最好的选择 我有过几个流畅的 NHibern
  • 骆驼:我如何异步发送到端点

    如何在不等待端点的路由被处理的情况下向端点发送消息 也就是说 我的路由应该只分派消息并完成 wireTap endpoint 就是答案
  • Fabric.js canvas.toDataURL() 通过 Ajax 发送到 PHP

    当我需要创建具有透明背景的图像时 我遇到了问题 我还是不知道问题出在fabricjs还是php 当我发送带有彩色背景的图像时 一切正常 当我发送具有透明背景的图像时会出现问题 生成的图像是用黑色背景创建的 那么 让我更好地解释一下 当用户单
  • 无法使用 Rails 3.2 创建插件?

    我在最新版本中遇到了 Rails 问题 我创建了一个新应用程序 rails new MyProject 但我没有脚本 生成 只有脚本 rails 当我输入时 ruby script rails generate plugin my plug
  • 调用多个ajax调用

    ajax url jsonpCallback item contentType application json dataType jsonp success function data console log data var marku
  • 为什么存储开销会在 C# 数据类型中产生浪费?

    在副主题中存储开销 关于章节 C 5 0 简而言之书上有这样一条一般性注释 现在 我想知道为什么 struct 中的字段A造成空间浪费 或者 作者整篇笔记的要点是什么 Each byte字段占用1个字节 而每个long字段占用8个字节 这意
  • FirebaseRemoteConfigClientException:Firebase 安装无法获取用于提取的安装身份验证令牌

    我遇到异常 com google firebase remoteconfig FirebaseRemoteConfigClientException Firebase Installations failed to get installa
  • 如何删除因缩小以适合元素而自动换行引起的额外空间?

    我正在尝试使用收缩来贴合 container 它可以完美地工作 直到它包含的元素换行为止 这会使其扩展到 180 像素 screen dimensions width 250px height 100px background color
  • 串流期货列表的最有效方式

    我通过流式传输对象列表来调用异步客户端方法 该方法返回 Future 迭代调用后返回的 Future 列表的最佳方法是什么 以便处理先出现的 Future 注意 异步客户端仅返回 Future 而不返回 CompletableFuture
  • 如何获取ISP名称?

    如何在 Salesforce com 中捕获用户的 ISP 名称 该解决方案可以采用 Salesforce com 中的 JavaScript 例如 Apex VisualForce Pages 捕获用户 ISP 名称的网站示例是 http
  • 如何调试 Python 日志记录配置文件错误

    我已将 Python 的日志记录模块添加到我的代码中 以避免混乱的打印语句 但我却因配置错误而陷入困境 错误消息的信息不是很丰富 Traceback most recent call last File HDAudioSync py lin
  • 左反加入Spark?

    我定义了两个表 如下所示 val tableName table1 val tableName2 table2 val format new SimpleDateFormat yyyy MM dd val data List List mi
  • Bootstrap 速度很慢如何让它更快

    我的网站是 设计辣 http designspicy com 我的网站在 bootstrap css 和 js 期间速度很慢 加载时间 3 56秒 通过 平多姆 bootstrap css 97 9 kB bootstrap js 28 7
  • PostgreSQL 不同主要版本的 pg_dump 和 pg_restore

    我的开发机器 称之为 D 运行 PostgreSQL 9 4 5 我的生产机器 称之为 P 运行 PostgreSQL 8 4 20 我不使用 PostgreSQL 9 x 中的任何新功能或类型 有时我需要在 D 上镜像 P 的状态 有时我
  • 如何使用开发分支中的一行命令更新本地 master 并重新设置其基准?

    假设我正在一个名为dev那就是跟踪master 如果我想更新我的主分支 我需要经常运行这一系列命令 git checkout master git pull git checkout dev git rebase i master 当我在
  • 使用 Eclipse 的 JAX-RPC 规范不支持数据类型的大错误

    这以前从未发生过 我从未见过任何这些警告 一定有一个我遗漏的小修复 我无法像它所说的那样取出类 对象 映射等的所有实例 我之前在同一个网络服务中使用过这些 没有任何问题 我添加了一种与其他方法类似的方法 我得到这个 S 有人可以帮忙吗 Th
  • Apache Beam:跳过已构建的管道中的步骤

    有没有办法有条件地跳过已构建的管道中的步骤 或者管道构建是否被设计为控制运行哪些步骤的唯一方法 通常 管道构造控制将执行管道中的哪些转换 但是 您可以想象一个输入 多个输出ParDo复用输入PCollection到输出之一PCollecti
  • 如何在Shiny中实时刷新sliderInput()(不仅仅是滑动结束时)?

    抱歉 不知道问题说得够清楚吗 在Shiny中 滑块每次滑动时 只会计算并更新滑动结束时的值 如果我将它的值链接到图表上 滑动时看起来不太平滑 图表只会在释放鼠标时或几秒钟后发生变化 而不是随着滑动而不断变化 使用滑动条改变y 图表中红点的位
  • WCF 服务基地址 Http 和 netTcp

    我的 WCF 服务配置文件中定义了两个基址