Skip to content

AT&T Developer Program

AT&T Developer
  • Products
  • Resources
  • Blog
  • Sign In
  1. Forums
  2. API Platform
  3. STOMP CONNECTION using Websocket

API Platform|STOMP CONNECTION using Websocket


Please Sign in to reply to a thread or create a new forums post. Not yet a member? Join Now.
by Replied by shawncanada
9 Posts
12 Comments
Joined Mar 06, 2013
STOMP CONNECTION using Websocket Apr 22, 2014 07:38 AM
<P>Hi,</P><P>I need to establish the STOMP connection using Web Socket, I checked the documentation&nbsp;<A target="_blank" href="https://developer.att.com/static-assets/documents/apis/in-app-messaging.pdf" rel="nofollow noopener noreferrer">https://developer.att.com/static-assets/documents/apis/in-app-messaging.pdf</A></P><P>and when I try to connect with the ATT server the event OnOpen not fires. Here an example:</P><P>&nbsp;</P><P>class Program<BR />{<BR />static void Main(string[] args)<BR />{<BR />var client = new XSocketClient("wss://encprodsockjs.att.net/stomp/websocket", "*");</P><P>client.OnOpen += (sender, eventArgs) =&gt; Console.WriteLine("OPEN");<BR />client.Bind("foo", message =&gt; Console.WriteLine(message.data));<BR />client.Open();</P><P>//Send a message for every key press... Until Escape<BR />ConsoleKeyInfo cki;<BR />Console.WriteLine("Press the Escape (Esc) key to quit and any other key to send a message: \n");<BR />do<BR />{<BR />cki = Console.ReadKey();<BR />if (cki.Key != ConsoleKey.Escape) {<BR />//Send a message<BR />client.Send("Hello this is the c# client!!", "foo");<BR />}<BR />} while (cki.Key != ConsoleKey.Escape);<BR />}<BR />}</P><P>But If I replace the ATT server by my local server &nbsp;"<SPAN>ws://127.0.0.1:4502/Generic" &nbsp;the event fires.</SPAN></P><P><SPAN>&nbsp;</SPAN></P><P><SPAN>An the other hand, also I try to setup connection using the login and passcode in order to use the Send method but the event not fire:</SPAN></P><P><SPAN>&nbsp;</SPAN></P><P>string username = "*************************";<BR />string password = "*************************";</P><P>StringBuilder RequestConnection = new StringBuilder();<BR />RequestConnection.Append("CONNECT");<BR />RequestConnection.Append("\r\n");<BR />RequestConnection.Append("accept-version: 1.1");<BR />RequestConnection.Append("\r\n");<BR />RequestConnection.Append("login : " + username);<BR />RequestConnection.Append("\r\n");<BR />RequestConnection.Append("passcode :" + password);<BR />RequestConnection.Append("\r\n");<BR />RequestConnection.Append("\0");<BR />strRequestConnection = Convert.ToString(RequestConnection);</P><P>//oXSocketClient.OnOpen += oXSocketClientOpen;<BR />oXSocketClient.Open();<BR />oXSocketClient.Send(strRequestConnection);</P><P>&nbsp;</P><P>Any ideas ?</P><P>&nbsp;</P><P>Regards</P><P>&nbsp;</P>
by Replied byalockridge
0 Posts
17 Comments
Joined Jul 10, 2013
'Re: STOMP CONNECTION using Websocket' Apr 22, 2014 09:08 AM

Hi,

 

In reviewing your code, the question of what you are attempting to accomplish comes to mnd. The SDK would be your best bet, depending on what you want to do.

Beyond this, I suggest starting with a known good cURL script which works as you need.

Then create your code duplicating the same header and body details. Once that works, you can further expand for your use.

 

Best wishes,

Tier 3 Support

AT&T API Platform

 

by Replied byshawncanada
9 Posts
12 Comments
Joined Mar 06, 2013
'Re: STOMP CONNECTION using Websocket' Apr 22, 2014 02:20 PM

Hi, Thanks for your response. I've tried to do a simple html page in order to establish the connection and in the google console appers this message : "WebSocket connection to 'wss://encprodsockjs.att.net/stomp/websocket' failed: Error during WebSocket handshake: Sent non-empty 'Sec-WebSocket-Protocol' header but no response was received" and I don't know why....

 

 

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="Scripts/XSockets.latest.js"></script>
<script src="Scripts/jquery-2.1.0.js"></script>
<script>
var conn;
conn = new XSockets.WebSocket('wss://encprodsockjs.att.net:443/stomp/websocket', 'myprotocol');
conn.on(XSockets.Events.open, function (clientInfo) {
console.log('Open', clientInfo);
});

</script>
</head>
<body>
</body>
</html>

by Replied byalockridge
0 Posts
17 Comments
Joined Jul 10, 2013
'Re: STOMP CONNECTION using Websocket' Apr 23, 2014 11:25 AM

As far as I can tell, this isn't a valid address within the AT&T web site. How are you getting this address?

I would suggest trying the SDK directly. It is written to work with HTML web pages and Java.

 

Tier 3 Support

AT&T API Platform

by Replied byshawncanada
9 Posts
12 Comments
Joined Mar 06, 2013
'Re: STOMP CONNECTION using Websocket' Apr 23, 2014 03:27 PM

I use the getnotificationdetail method in order to obtain the wss url:

 

GET /myMessages/v2/notificationConnectionDetails?queues=MMS HTTP/1.1
host: api.att.com
authorization: Bearer xyz123456789
accept: application/json

 

and this request returns:


{"notificationConnectionDetails":
{"username":"xxxxxxxxxxxxxxxxxxxxxx",
"password":"xxxxxxxxxxxxxxxxxxxxxxx",
"httpsUrl":"https://encprodsockjs.att.net/stomp",
"wssUrl":"wss://encprodsockjs.att.net/stomp/websocket",
"queues":

{"mms":"/amq/queue/xxxxxxxxxxxxxxxxxxxxxxxxxxx"}
}

by Replied byalockridge
0 Posts
17 Comments
Joined Jul 10, 2013
'Re: STOMP CONNECTION using Websocket' Apr 24, 2014 10:04 AM

Please file a ticket and I can dig deeper into this issue.

 

Thanks,

Tier 3 Support

AT&T API Platform

by Replied bypoojag
0 Posts
3 Comments
Joined Aug 28, 2013
'Re: STOMP CONNECTION using Websocket' Apr 24, 2014 02:31 PM

Hello Shawn,

 

As suggested in my earlier mail via salesforce ticket 00008545, please use these details in your code to connect to websocket server.

 

You can refer or use the code at https://github.com/maymount/iam_stomp

 

Please let me know if you need any help.

 

Regards,

Pooja

 

 

 

 

 

by Replied byshawncanada
9 Posts
12 Comments
Joined Mar 06, 2013
'Re: STOMP CONNECTION using Websocket' Apr 29, 2014 03:21 PM

Thank you for help, finally I used the WebSocket4Net library in order to establish the stomp connection using websocket and works!. This is the link: http://websocket4net.codeplex.com/ 

Thanks You!

 

 

Please confirm that you want to flag this content as inappropriate.

???forums.modal.inappropriate.message???
Please confirm that you want to delete this content.

Click here to go to top of the page
  • APIS & TOOLS
    • AT&T Video Optimizer
  • APIS & TOOLS
    • Futurist Reports
    • Technical Library
  • SUPPORT
    • Contact Us
    • FAQs
    • Twitter
  • AT&T Developer Program on Github
  • AT&T Developer Program on Facebook
  • AT&T Developer Program on Twitter
AT&T Logo

Terms of Use   Privacy Policy   Your Privacy Choices California Consumer Privacy Act (CCPA) Opt-Out Icon
©2025 AT&T Intellectual Property. All rights reserved

AT&T, the AT&T logo and all other AT&T marks contained herein are trademark of AT&T Intellectual Property and/or AT&T affiliated companies.