Please report new issues athttps://github.com/DOCGroup
With the specified configuration, code similar to the following: IOP::ServiceContext_var context = ... // get context
Created attachment 65 [details] Complete bug description (previously ommitted)
*** Bug 932 has been marked as a duplicate of this bug. ***
*** Bug 934 has been marked as a duplicate of this bug. ***
Below are the contents of Greg's attachment. It's easier to have them available in the bug comments. Thanks for tracking this down Greg! ------------------------------------------------------------- I accidently sent the bug in an incomplete form, here's the complete description: With the specified configuration, code similar to the following IOP::ServiceContext_var context = ... // get a service context IOP::Codec_var codec = ... // get a codec Any_var ctxVal = codec->decode(context->context_data); produces a compile-time error on MSVC similar to: error C2664: 'decode' cannot convert parameter 1 from 'class IOP::ServiceContext::_tao_seq_Octet' to 'const class CORBA_OctetSeq &' due to the fact that the PIDL argument type for the decode operation is mapped differently from IOP::ServiceContext context_data member: local interface Codec { ... any decode(in CORBA::OctetSeq) ... ... }; and struct ServiceContext { ... sequence<octet> context_data; }; The workaround is to construct a temporary CORBA::OctetSeq type from the ServiceContext member. e.g. CORBA::OctetSeq tmp( context->context_data.length(); context->context_data.length(); context->context_data.get_buffer(); 0); and pass it as the argument. I'm not totally sure this is a bug as such, but it would be handy to able to have the CORBA::OctetSeq be used interchangeably with the anonymous Octet sequence type (especially since the OctetSeq is just a typedef of the anonymous type).
Ossama, do you want to accept this bug?
I'm reluctant to do so because this bug is not specific to Portable Interceptors.
Hi, I also encountered this problem while writing an example for Portable Interceptors and used the same workaround. But when I try to decode this CORBA::OctetSeq, I get an exception. Since I couldn't figure out why that is happenning I wrote another example and it is like this: In the servant class I have a method called send_message() which takes in a reference to a CORBA::OctetSeq virtual void send_message (const CORBA::OctetSeq & user_name) ACE_THROW_SPEC ((CORBA::SystemException)); and in the implementation for this method what I try to do is decode it: CORBA::Any_var user_name_as_any; user_name_as_any = codec->decode(user_name); I was able to get this to build but when I try to run it I get a IDL:omg.org/IOP/Codec/FormatMismatch:1.0 exception. Hope someone can give an idea to resolve this. Thanks Ru
We're going to need more information than that. How did you encode the octet sequence? Can you please provide a more complete example?
Created attachment 103 [details] codec example
I added the complete example as an attachment (id=103). To build this example I used ACE version 1.2 and TAO version 1.2.
pidl interface is changed long time ago, regression was infact broken Tue Mar 27 13:56:40 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> * tests/Bug_933_Regression/*: New regression for bug 933. TAO didn't had a bug, the regression posted by the reporter had several. Fixed the regression and adding it now to svn. Thanks to Ruwanganie Gunatilleke <ru at ociweb dot com> for making the regression