• <tfoot id='YWfyy'></tfoot>

        <legend id='YWfyy'><style id='YWfyy'><dir id='YWfyy'><q id='YWfyy'></q></dir></style></legend>
      1. <i id='YWfyy'><tr id='YWfyy'><dt id='YWfyy'><q id='YWfyy'><span id='YWfyy'><b id='YWfyy'><form id='YWfyy'><ins id='YWfyy'></ins><ul id='YWfyy'></ul><sub id='YWfyy'></sub></form><legend id='YWfyy'></legend><bdo id='YWfyy'><pre id='YWfyy'><center id='YWfyy'></center></pre></bdo></b><th id='YWfyy'></th></span></q></dt></tr></i><div id='YWfyy'><tfoot id='YWfyy'></tfoot><dl id='YWfyy'><fieldset id='YWfyy'></fieldset></dl></div>

        <small id='YWfyy'></small><noframes id='YWfyy'>

          <bdo id='YWfyy'></bdo><ul id='YWfyy'></ul>

        Reporting Services - 通过自定义程序集使用 Web 服务:查找端点

        Reporting Services - Using a web service via a custom assembly: Finding the endpoint(Reporting Services - 通过自定义程序集使用 Web 服务:查找端点)
        <tfoot id='gDQFx'></tfoot>
        <legend id='gDQFx'><style id='gDQFx'><dir id='gDQFx'><q id='gDQFx'></q></dir></style></legend>

        <i id='gDQFx'><tr id='gDQFx'><dt id='gDQFx'><q id='gDQFx'><span id='gDQFx'><b id='gDQFx'><form id='gDQFx'><ins id='gDQFx'></ins><ul id='gDQFx'></ul><sub id='gDQFx'></sub></form><legend id='gDQFx'></legend><bdo id='gDQFx'><pre id='gDQFx'><center id='gDQFx'></center></pre></bdo></b><th id='gDQFx'></th></span></q></dt></tr></i><div id='gDQFx'><tfoot id='gDQFx'></tfoot><dl id='gDQFx'><fieldset id='gDQFx'></fieldset></dl></div>
          • <small id='gDQFx'></small><noframes id='gDQFx'>

            • <bdo id='gDQFx'></bdo><ul id='gDQFx'></ul>
                  <tbody id='gDQFx'></tbody>

                • 本文介绍了Reporting Services - 通过自定义程序集使用 Web 服务:查找端点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在报告中使用自定义程序集时遇到问题.我们正在使用带有 Reporting Services 的 Microsoft SQL Server 2012 Express Edition,并且正在 Microsoft Visual Studio 2010 中设计我们的报表

                  I'm having a problem when using a Custom Assembly in my reports. We are using a Microsoft SQL Server 2012 Express Edition with Reporting Services and are designing our reports in Microsoft Visual Studio 2010

                  场景:在 Reporting Services 中,我们希望基于参数来确定报表的语言.所有字符串都在具有简单翻译"方法的 Web 服务的帮助下进行翻译.因为我们无法在报告中引用 Web 服务,所以我们使用了访问 Web 服务的自定义程序集.在为程序集提供正确的权限后,将 .dll 放在正确的位置,一切都变得很有吸引力.

                  Scenario: In Reporting Services we want to base the language of a report based on a parameter. All the strings are translated with the help of a web service that has a simple "Translate" method. Because we cannot reference to a web service in the report, we used a custom assembly that accesses the web service. After giving the assembly the correct permissions, placing the .dll in the correct places everything worked as a charm.

                  问题:在自定义程序集中引用 Web 服务时,会生成带有 system.serviceModel 节点的 app.config 文件如下所示.

                  Problem: When the web service is referenced to in the custom assembly a app.config file is generated with a system.serviceModel node as seen below.

                  <system.serviceModel>
                      <bindings>
                          <basicHttpBinding>
                              <binding name="ITranslatorServicebinding" closeTimeout="00:01:00"
                                  openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                                  allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                                  maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                                  messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                                  useDefaultWebProxy="true">
                                  <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                                      maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                                  <security mode="None">
                                      <transport clientCredentialType="None" proxyCredentialType="None"
                                          realm="" />
                                      <message clientCredentialType="UserName" algorithmSuite="Default" />
                                  </security>
                              </binding>
                          </basicHttpBinding>
                      </bindings>
                      <client>
                          <endpoint address="WebServiceAddress"
                              binding="basicHttpBinding" bindingConfiguration="TranslatorServicebinding"
                              contract="Translator.ITranslatorService" name="ITranslatorServicePort" />
                      </client>
                  </system.serviceModel>
                  

                  显然,当在应用程序中使用 dll 时,该 dll 的配置文件应该位于引用它的应用程序的位置.因为在使用 Reporting Services 时我不知道在哪里存储这个特定的配置文件,所以我决定通过以下代码以编程方式添加它:

                  Appearantly when a dll is used in an application, that dll's config file should be at the location of the application that references it. Because I have no idea where to store this particular config file when using Reporting Services I decided to add it programmatically via the following code:

                  var remoteAddress = new System.ServiceModel.EndpointAddress(YourWebServiceURI);
                  using (var translateService = new Translator.TranslatorServiceClient(new System.ServiceModel.BasicHttpBinding(), remoteAddress))
                  {
                     translateService.Endpoint.Binding.SendTimeout = new TimeSpan(0, 0, 1, 0);
                     return translatedString = translateService.Translate(ISOCode, NativeString);
                  }
                  

                  这足以让程序集找到 Web 服务并使用它.但是,如您所见,YourWebServiceUri 在程序集中是硬编码的.我想避免这种情况.然后我决定在 Reporting Services 的 web.config 文件中添加一个密钥,如下所示:

                  This was enough for the assembly to find the web service and use it. However, as you can see, the YourWebServiceUri is hardcoded in the assembly. I want to avoid this. Then I decided to add a key in the web.config file of Reporting Services like this:

                  <appSettings>
                    <add key="WebServiceUri" value="YourWebServiceURI"/>
                  </appSettings>
                  

                  但是,如果出于某种原因我想更改 basicHttpBinding 中的设置,那么我会以编程方式添加它并重建程序集.为了避免这种情况,我想知道是否可以将 ServiceModel 复制并粘贴到配置文件中的某个位置,以便 Reporting Services 能够识别它.

                  However, if, for some reason I want to change settings in the basicHttpBinding then I'd have add this programmatically and rebuild the assembly. To avoid this, I want to know if I could Copy&Paste the ServiceModel somewhere in a config file so that the Reporting Services can recognize it.

                  问题:我需要调整哪个配置文件才能让自定义程序集获取端点并设法连接到 Web 服务?

                  QUESTION: Which config file do I need to adjust in order for the custom assembly to pick up the endpoint and manage to connect to the web service?

                  您已经可以假设我设置了正确的权限并且 dll 位于正确的位置.但是,我不知道将 app.config 存储在哪里,或者我需要更改哪个配置文件.

                  You can already assume I have the correct permissions set up and that the dll is in the correct place. I do not know however where to store the app.config, or which configuration file I need to alter.

                  推荐答案

                  最后是 web.config 我需要用 system.serviceModel 进行更改.重新启动报表服务器很重要,否则更改将不会生效.问题已解决.

                  In the end it was the web.config I need to alter with the system.serviceModel. It's important to restart the Report Server otherwise the changes will not take effect. Problem fixed.

                  这篇关于Reporting Services - 通过自定义程序集使用 Web 服务:查找端点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  SQL Server add auto increment primary key to existing table(SQL Server 向现有表添加自动增量主键)
                  Altering a column: null to not null(改变列:null 到 not null)
                  Adding an identity to an existing column(向现有列添加标识)
                  How to write UPDATE SQL with Table alias in SQL Server 2008?(如何在 SQL Server 2008 中使用表别名编写 UPDATE SQL?)
                  Why can#39;t I use alias in a count(*) quot;columnquot; and reference it in a having clause?(为什么我不能在计数(*)“列中使用别名?并在具有条款中引用它?)
                  SQL Server 2005 quot;publicquot; database role doesn#39;t seem to apply?(SQL Server 2005“公共数据库角色似乎不适用?)

                • <legend id='QOJaa'><style id='QOJaa'><dir id='QOJaa'><q id='QOJaa'></q></dir></style></legend>

                  <small id='QOJaa'></small><noframes id='QOJaa'>

                  • <bdo id='QOJaa'></bdo><ul id='QOJaa'></ul>

                      • <i id='QOJaa'><tr id='QOJaa'><dt id='QOJaa'><q id='QOJaa'><span id='QOJaa'><b id='QOJaa'><form id='QOJaa'><ins id='QOJaa'></ins><ul id='QOJaa'></ul><sub id='QOJaa'></sub></form><legend id='QOJaa'></legend><bdo id='QOJaa'><pre id='QOJaa'><center id='QOJaa'></center></pre></bdo></b><th id='QOJaa'></th></span></q></dt></tr></i><div id='QOJaa'><tfoot id='QOJaa'></tfoot><dl id='QOJaa'><fieldset id='QOJaa'></fieldset></dl></div>

                            <tbody id='QOJaa'></tbody>

                          <tfoot id='QOJaa'></tfoot>