Hi All,
I want to use Messeger Demo of Java to apply for DotNet? How to config adapter, implement MetadataProvider and DataAdapter to send private message to client?
Thanks!
Hi All,
I want to use Messeger Demo of Java to apply for DotNet? How to config adapter, implement MetadataProvider and DataAdapter to send private message to client?
Thanks!
Hi,
try to check out the .NET version of the PortfolioDemo (available in our distribution under LS_HOME/DOCS-SDKs/sdk_adapter_dotnet/examples/Remote_Portfolio_Adapters).
That demo was directly ported from the Java version, you should do the same with the MessengerDemo.
Let me know if and where you get stuck.
Thank for the reply.
Could you explain about the prameters of metadata_provider? And When I configure the info of metada_provider (match_id, tem_family, ...) on "adapters.xml" file, I don't recieve that parameters on "Init" function of MetadataProviderAdapter.
Thanks.
writing a .NET adapter you don't need to use the match_id to match your metadata adapter and your data adapter;
Check the class StandaloneAdaptersLauncher in the folder LS_HOME/DOCS-SDKs/sdk_adapter_dotnet/examples/Remote_Portfolio_Adapters/src_standalone_launcher . There the metadata adapter and the data adapter are instantiated and "connected" through the setFeed calls.
Before that, command line parameters are parsed and then passed to the init methods. So, if you need to add custom parameters you can do that by acting on the bat file ( LS_HOME/DOCS-SDKs/sdk_adapter_dotnet/examples/Remote_Portfolio_Adapters/Deployment/Deployment_DotNet_Server(custom) )
Parameters in the adapters.xml file are only passed to java adapters; In your case those are the parameters used by the remote java adapters to accept data from their .NET counterparts.
HTH
Hi Mone! Thanks for the reply, I've connected between metadata adapter and the data adapter through the setFeed. On the web client, I use "DynaScrollTable" to recieve messages from the "NotifyUserMessage" function on the metada adapter. Here is my code:
And here is DataAdapter Code:Code:var group = "im_" + userName; var schema = ["fromNick", "toNick", "message"]; var imTable = new DynaScrollTable(group, schema, "DISTINCT"); imTable.setDataAdapter("PROXY_HS_MARKETDATA"); imTable.setSnapshotRequired(false); imTable.setPushedHtmlEnabled(false); imTable.setMaxDynaRows("unlimited"); imTable.setUpwardScroll(true); imTable.setAutoScroll("ELEMENT","message_scroll"); imTable.onChangingValues = function(domNode, visualUpdateInfo) { if (visualUpdateInfo != null) { var from = visualUpdateInfo.getServerValue("fromNick"); //Don't recieve message from DataAdater alert(from); } }; pushPage.addTable(imTable, "messages");
I don't know why the web client doesn't receive any messages.Code:// Call by Metadata to notify to client public void sendMessage(string from, string to, string message) { if (localListener != null) { IDictionary dic = new Hashtable(); dic.Add("fromNick", from); dic.Add("toNick", to); dic.Add("message", message); localListener.OnUpdate(dic); } }
Thanks and Regards!
please before digging your code did you verify that the environment is correctly configured?
Are you able to correctly run one of the internal demos?
Are you able to correctly run the .NET version of the PortfolioDemo?
Yes, I run and base on PortfolioDemo to develope a demo to send messages one by one client, here is the returned result from server:Originally Posted by Mone
Code:30.Dec.10 09:47:39,734 < INFO> Attaching session: S5eff9a610bd223b7T4739671 from 127.0.0.1:2407 30.Dec.10 09:47:48,093 < INFO> Serving request: /lightstreamer/control.js --> LS _session=S5eff9a610bd223b7T4739671&LS_table=0&LS_win_phase=27&LS_op=add&LS_req_p hase=740&LS_mode=DISTINCT&LS_id=im_test&LS_schema=fromNick%20toNick%20message&LS _data_adapter=PROXY_HS_MARKETDATA&LS_unique=1& from 127.0.0.1:2402 30.Dec.10 09:47:48,109 < INFO> Controlling session: S5eff9a610bd223b7T4739671 fr om 127.0.0.1:2402 30.Dec.10 09:48:00,375 < INFO> Serving request: /lightstreamer/send_message.js - -> LS_session=S5eff9a610bd223b7T4739671&LS_message=IM%7CFromUser%7Ctest%7CHello& LS_req_phase=0&LS_sequence=Messages&LS_max_wait=5000&LS_unique=2& from 127.0.0.1 :2404 30.Dec.10 09:48:00,375 < INFO> Sending message to session: S5eff9a610bd223b7T473 9671 from 127.0.0.1:2404
Ok, Thanks Mone!
I have fixed.
Bookmarks