首页 \ 问答 \ 客户端配置设置(Client side configuration settings)

客户端配置设置(Client side configuration settings)

我有一个Windows应用程序调用WCF服务来构建一个特定的URL。

从Windows应用程序调用的WCF函数接受数组形式的位置详细信息。

我遇到一个问题,当发送到WCF函数的数组大小很小时(例如10),服务返回正确的结果。

但是当数组大小增加时(例如> 200),服务将返回400 Bad请求。

我不确定数组大小或数组内容是否导致此问题。

我试图更改服务器(服务)端web.config以接受最大缓冲区大小。

<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IServiceContract" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" 

sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" 

maxBufferSize="2147483647" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" messageEncoding="Text" 

textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" 

maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
          <security mode="None">
            <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>


</basicHttpBinding>
</bindings>

<system.web>
    <compilation debug="true" targetFramework="4.0" />
            <httpRuntime executionTimeout="90" maxRequestLength="1048576" useFullyQualifiedRedirectUrl="false" 

minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="100" />
  </system.web>

我仍然面临同样的问题。

在客户端(这里是windows应用程序),我们如何设置配置设置,以便客户端能够将大数据发送到服务器端?


I have a windows application which calls to a WCF service to build a specific URL.

The WCF function which gets called from windows application accepts location details in the form of an array.

I face a problem the when array size sent to WCF function is small (for eg. 10) then the service returns correct result.

But when the array size grows (for eg. >200) then service returns a 400 Bad request.

I am not sure if the array size or the array contents are causing this problem.

I have tried to change the server (service) side web.config to accept the max buffer size.

<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IServiceContract" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" 

sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" 

maxBufferSize="2147483647" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" messageEncoding="Text" 

textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" 

maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
          <security mode="None">
            <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>


</basicHttpBinding>
</bindings>

<system.web>
    <compilation debug="true" targetFramework="4.0" />
            <httpRuntime executionTimeout="90" maxRequestLength="1048576" useFullyQualifiedRedirectUrl="false" 

minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="100" />
  </system.web>

Still I am facing the same issue.

In client side (here windows application) how can we set the configuration settings so that client will be able to send large data to server side?


原文:https://stackoverflow.com/questions/14745447
更新时间:2022-05-16 21:05

最满意答案

您可以通过com.sun.star.drawing.BitmapTable对象将图像嵌入到OOo文档中。 以下函数将获取文档(其XMultiServiceFactory接口),指向您选择的图像文件的File对象和必须唯一的internalName,嵌入图像并返回指向嵌入实例的URL。

/**
 * Embeds an image into the document and gets back the new URL.
 *
 * @param factory Factory interface of the document.
 * @param file Image file.
 * @param internalName Name of the image used inside the document.
 * @return URL of the embedded image.
 */
public static String embedLocalImage(XMultiServiceFactory factory, File localFile, String internalName) {

    // future return value
    String newURL = null;

    // URL of the file (note that BitmapTable expects URLs starting with
    // "file://" rather than just "file:". Also note that getRawPath() will
    // return an encoded URL (with special character in the form of %xx).
    String imageURL = "file://" + localFile.toURI().getRawPath();

    try {

        // get a BitmapTable object from the document (and get interface)
        Object bitmapTable = factory.createInstance("com.sun.star.drawing.BitmapTable");
        XNameContainer bitmapContainer = (XNameContainer)UnoRuntime.queryInterface(XNameContainer.class, bitmapTable);

        // insert image by URL into the table
        bitmapContainer.insertByName(internalName, imageURL);

        // get interface
        XNameAccess bitmapAccess = (XNameAccess)UnoRuntime.queryInterface(XNameAccess.class, bitmapTable);

        // get the embedded URL back
        newURL = (String)bitmapAccess.getByName(internalName);

    } catch (Exception e) {
        throw new RuntimeException(e);
    }

    // return the new (embedded) url
    return newURL;
}

You can embed images into an OOo document thru the com.sun.star.drawing.BitmapTable object. The following function will take the document (its XMultiServiceFactory interface), a File object pointing to the image file of your choice and an internalName which has to be unique, embeds the image and returns the URL pointing to the embedded instance.

/**
 * Embeds an image into the document and gets back the new URL.
 *
 * @param factory Factory interface of the document.
 * @param file Image file.
 * @param internalName Name of the image used inside the document.
 * @return URL of the embedded image.
 */
public static String embedLocalImage(XMultiServiceFactory factory, File localFile, String internalName) {

    // future return value
    String newURL = null;

    // URL of the file (note that BitmapTable expects URLs starting with
    // "file://" rather than just "file:". Also note that getRawPath() will
    // return an encoded URL (with special character in the form of %xx).
    String imageURL = "file://" + localFile.toURI().getRawPath();

    try {

        // get a BitmapTable object from the document (and get interface)
        Object bitmapTable = factory.createInstance("com.sun.star.drawing.BitmapTable");
        XNameContainer bitmapContainer = (XNameContainer)UnoRuntime.queryInterface(XNameContainer.class, bitmapTable);

        // insert image by URL into the table
        bitmapContainer.insertByName(internalName, imageURL);

        // get interface
        XNameAccess bitmapAccess = (XNameAccess)UnoRuntime.queryInterface(XNameAccess.class, bitmapTable);

        // get the embedded URL back
        newURL = (String)bitmapAccess.getByName(internalName);

    } catch (Exception e) {
        throw new RuntimeException(e);
    }

    // return the new (embedded) url
    return newURL;
}

相关问答

更多
  • 做了一些研究并最终使用firebreath(http://www.firebreath.org/)创建了本机NPAPI插件并将其用于我自己的扩展。 我愿意在https://github.com/magomi/OOCaller上提供关于此的建议和讨论 Did some research and finally used firebreath (http://www.firebreath.org/) to create a native NPAPI plugin and to use it in my own ...
  • 好的,这就是我为实现这一点所做的(使用OpenOffice UNO Api和JAVA): 加载我们要放置HTML文本的odt文档。 转到要放置HTML文本的位置。 将HTML文本保存在系统的临时文件中(也许可以不使用http URL保存,但我没有测试它)。 按照此说明将HTML插入odt并将URL传递给临时HTML文件(记住将系统路径转换为OO路径)。 OK, this is what I've done to achieve this (using OpenOffice UNO Api with JAVA ...
  • 以下代码将所有正确的命名空间加载到命名空间管理器中并创建示例文档。 .NET只会输出文档中实际使用的命名空间,而不是所有命名空间。 我不确定是否有办法强制输出未使用的输出,但实际上不需要使用未使用的输出。 public static void Test() { var nt = new NameTable(); var ns = new XmlNamespaceManager(nt); var doc = new XmlDocument(nt); ns.AddNamespa ...
  • 您可以通过com.sun.star.drawing.BitmapTable对象将图像嵌入到OOo文档中。 以下函数将获取文档(其XMultiServiceFactory接口),指向您选择的图像文件的File对象和必须唯一的internalName,嵌入图像并返回指向嵌入实例的URL。 /** * Embeds an image into the document and gets back the new URL. * * @param factory Factory interface of the ...
  • 很相似:) 以下是描述用于配置生成的文档的所有功能的教程。 对于以下示例,我选择适合宽度放大,密码保护和隐藏窗口控件。 当转换时未显示OpenOffice窗口时,导出将以隐藏模式完成。 请注意,以下代码再次没有错误处理。 uses ComObj; procedure OpenOfficeExportToPDF(const ASourceFileURL: string; const ATargetFileURL: string); var StarOffice: Variant; StarDes ...
  • 是。 您可以使用odf库。 http://opendocumentfellowship.com/projects/odfpy 您将获得的文档将采用ODF格式,但您可以稍后使用unoconv将其转换为PPT 格式 。 Yes. You can use the odf library. http://opendocumentfellowship.com/projects/odfpy The document you'll get will be in ODF format but you can later c ...
  • 我使用c#SDK而不是OLE解决了我的问题,所以这不是关于OLE问题的完全答案。 我建议使用SDK,因为您可以从官方API的预定义对象模型中受益,而在com interop中没有这样的指南。 您必须在系统上安装Openoffice SDK,然后在您的c#项目中添加对此目录中所有dll的引用: ... \ OpenOffice 4 \ sdk \ cli \ cli_basetypes.dll 这些页面包含使用c#API的实际示例: http://suite101.com/a/creating-an-open ...
  • 我想你的问题出现在“Name.Of.Macro”中:它必须是:Library.Module.NameOfMacro。 “langauge = Basic”当然设置语言名称,“location = application”表示应该在打开的文档中搜索宏库,而不是在全局OO库中搜索。 就参数而言,我使用: XScriptProviderSupplier xScriptPS = (XScriptProviderSupplier) UnoRuntime.queryInterface(XScriptProviderSu ...
  • 实际上有一些东西可以满足而不会有很多麻烦。 这将是XForms,在这里描述: http://wiki.services.openoffice.org/wiki/Documentation/OOo3_User_Guides/Writer_Guide/Using_Forms_in_Writer 这几乎可以解释我应该做的任何事情。 Actually there is something that would suffice without a lot of hassle. This would be XForms ...
  • 试试jmpress.js - 查看其主页上的展示和关于codrops的本教程 。 它们似乎完全符合您的需求。 Try out jmpress.js -- look at the showcase on its home website and this tutorial on codrops. They seem to have exactly what you need.

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。