如何从 CORBA 客户端为 WChar 字符串指定 CodeSet
这个问题与我一直在努力解决的另一个问题有关: 如何在不使用 CORBA 接口的情况下访问 CORBA 接口IDL 或后期绑定调用远程处理方法
我真的很困惑如何克服有关未指定 CodeSet 的错误。我一直在跟踪 IIOP 代码,试图找出如何指定 CodeSet,看起来可以使用与配置文件关联的标记组件来指定它。由于不熟悉 CORBA,我不知道什么是标记组件,什么是配置文件,也不知道如何控制它们,但我怀疑它可能会受到创建便携式对象拦截器的影响,此时我可以添加一个标记的 CodeSet配置文件的组成部分,如果这意味着什么的话。我只是根据我可以从 IIOP.NET 代码和 Google 中学到的知识进行操作。
有人可以帮助我理解并希望控制这个吗?如果服务器是一个黑匣子,并且我需要编写一个客户端来调用输出字符串的方法,那么我如何告诉 IIOP.NET 使用什么 WChar CodeSet,这样它就不会给出有关未指定的错误。我从客户端尝试了 OverrideDefaultCharSets,但这似乎没有任何效果。该函数的 IIOP 示例代码显示它在服务器端使用。
This question is related to another question with which I have been struggling:
How to access CORBA interface without IDL or late-bound invoke remoting methods
I'm really stumped on how to get past this error about the CodeSet not being specified. I have been tracing into the IIOP code trying to figure out how the CodeSet can be specified, and it looks like it could be specified with a tagged component associated with the profile. Being unfamiliar with CORBA, I don't know what a tagged component is or what a profile is or how to control them, but I suspect that it may be influenced by creating a portable object interceptor, at which point I could add a tagged CodeSet component to the profile, if that means anything. I'm just going by what I can learn from the IIOP.NET code and Google.
Could someone please help me understand and hopefully control this? If the server is a black box and I need to write a client to call a method that outputs a string, how do I tell IIOP.NET what WChar CodeSet to use so it doesn't give me an error about it being unspecified. I tried OverrideDefaultCharSets from the client, but that didn't seem to have any effect. The IIOP sample code for that function shows it being used on the server side.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决这个问题确实很痛苦,但我明白了:
不幸的是,在我的例子中,问题仍然是字节顺序也是向后的,所以我不得不采用一个完全不同的解决方案,基于只是得到返回字节并手动将它们转换为字符串,而不是直接获取字符串。
This was a real pain to work out, but I got it:
Unfortunately in my case the problem remained that the byte ordering was backwards too, so I had to go with an entirely different solution based on just getting bytes back and manually converting them to a string instead of getting string directly.