qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chuck Rolke <cro...@redhat.com>
Subject Re: encode/decode methods in C# client api
Date Thu, 06 Oct 2011 14:40:41 GMT
For C# you can use the .NET Binding.

A Variant::Map is represented in .NET as Dictionary<string, object> and
a Variant::List is represented in .NET as Collection<object>.

The encode and decode functions are called for you as the binding creates messages.
This is exposed in examples cpp\bindings\qpid\dotnet\examples\csharp.map.sender
and cpp\bindings\qpid\dotnet\examples\csharp.map.receiver.

To build the .NET binding you must have the BOOST_ROOT used to build qpid\cpp in your path,
and have QPID_BUILD_ROOT defined to be the directory in which cmake ran as it built the qpid-cpp.sln
file.

Regards,
Chuck

----- Original Message -----
> From: "Virgilio Alexandre Fornazin" <virgiliofornazin@gmail.com>
> To: users@qpid.apache.org
> Sent: Thursday, October 6, 2011 7:43:27 AM
> Subject: encode/decode methods in C# client api
> 
> Hi all
> 
>  
> 
> There are encode/decode methods in C++ qpid messaging api, but I
> can’t found
> a C# counterpart.
> 
> I’m using qpid-0.10 messaging api.
> 
>  
> 
> I need to send messages from a C# client to another already done C++
> application (that uses encode/
> 
> decode calls). How I can do this?
> 
>  
> 
> Below there´s the methods
> 
>  
> 
> /**
> 
>  * Decodes message content into a Variant::Map.
> 
>  *
> 
>  * @param message the message whose content should be decoded
> 
>  * @param map the map into which the message contents will be decoded
> 
>  * @param encoding if specified, the encoding to use - this overrides
> 
>  * any encoding specified by the content-type of the message
> 
>  * @exception EncodingException
> 
>  */
> 
> QPID_MESSAGING_EXTERN void decode(const Message& message,
> 
>                                qpid::types::Variant::Map& map,
> 
>                                const std::string& encoding =
>                                std::string());
> 
> /**
> 
>  * Decodes message content into a Variant::List.
> 
>  *
> 
>  * @param message the message whose content should be decoded
> 
>  * @param list the list into which the message contents will be
>  decoded
> 
>  * @param encoding if specified, the encoding to use - this overrides
> 
>  * any encoding specified by the content-type of the message
> 
>  * @exception EncodingException
> 
>  */
> 
> QPID_MESSAGING_EXTERN void decode(const Message& message,
> 
>                                qpid::types::Variant::List& list,
> 
>                                const std::string& encoding =
>                                std::string());
> 
> /**
> 
>  * Encodes a Variant::Map into a message.
> 
>  *
> 
>  * @param map the map to be encoded
> 
>  * @param message the message whose content should be set to the
>  encoded map
> 
>  * @param encoding if specified, the encoding to use - this overrides
> 
>  * any encoding specified by the content-type of the message
> 
>  * @exception EncodingException
> 
>  */
> 
> QPID_MESSAGING_EXTERN void encode(const qpid::types::Variant::Map&
> map,
> 
>                                Message& message,
> 
>                                const std::string& encoding =
>                                std::string());
> 
> /**
> 
>  * Encodes a Variant::List into a message.
> 
>  *
> 
>  * @param list the list to be encoded
> 
>  * @param message the message whose content should be set to the
>  encoded
> list
> 
>  * @param encoding if specified, the encoding to use - this overrides
> 
>  * any encoding specified by the content-type of the message
> 
>  * @exception EncodingException
> 
>  */
> 
> QPID_MESSAGING_EXTERN void encode(const qpid::types::Variant::List&
> list,
> 
>                                Message& message,
> 
>                                const std::string& encoding =
>                                std::string());
> 
>  
> 
> 

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Mime
View raw message