C# client to tak to Java Spring based Broker

Jan 26, 2015 at 9:22 PM
Hi,

I have my Websocket Stomp server built in Java (Spring based). My JavaScript client is able to talk to the server using Stomp over Web Socket.

I'm trying to use the WebSocket4Net library to build the C# client. Can anyone please tell me how can I build the Stomp message frames in bytes[] and send them to the server?

Simply put, in the OnOpen() method, I'm doing the following -
String stompMsg = "CONNECT\n";
stompMsg += "accept-version:1.1,1.2\n\n";
stompMsg += "^@";

Byte[] bytesToSend = Encoding.UTF8.GetBytes(stompMsg);
websocketObj.Send(bytesToSend, 0, bytesToSend.Length);
I get the following message from server -

Failed to parse BinaryMessage payload - java.nio.HeapByteBuffer. Sending STOMP ERROR to client.

Can anyone please suggest if you have used this client library with a spring based STOMP over Web Socket server?

Many Thanks