On the client, an RTX user sends messages to another RTX user!
My solution: deploy a WCF Service or WebService Service on the RTX server, and then the program can call the service on the client.
1, C #(4 DLL required for the server)
InterOP. rtxcapilib. dll
InterOP. rtxclient. dll
InterOP. rtxsapilib. dll
InterOP. rtxserverapi. dll
: Http://good.gd/1936542.htm
Server: (the above four DLL files need to be referenced)
Public String rtx_sendim (string ssender, string spwd, string smsg, string ssessionid, string sreceiver) {string serr = ""; try {rtxsapilib. rtxsapirootobj rootobj = new rtxsapirootobj (); // create the root object rootobj. sendim (ssender, spwd, sreceiver, smsg, ssessionid);} catch (exception ex) {serr = ex. message;} return serr ;}
Client:
private void btnWCF_Click(object sender, EventArgs e) { AAA.Service se = new AAA.Service(); if (cboWcfAddress.Text != "") se.Url = cboWcfAddress.Text; Guid id = Guid.NewGuid(); string sessionId = "{" + id.ToString() + "}"; string sErr = se.RTX_SendIM(txtSender.Text, txtSenderPwd.Text, txtMsg.Text, sessionId, txtReceiver.Text); if (!string.IsNullOrEmpty(sErr)) MessageBox.Show(sErr); }
2, VB6 (soaptoolkit needs to be installed on the client)
: Http://good.gd/1936572.htm
The server uses the server in the C # solution.
Client:
Private Sub btnSendWcf_Click() On Error GoTo ERR Dim sGuid As String sGuid = CreateObject("Scriptlet.TypeLib").Guid Dim soapClient As New SoapClient30 Dim text As String soapClient.MSSoapInit cboWcfAddress.text & "?wsdl" text = soapClient.RTX_SendIM(txtSender.text, txtSenderPwd.text, txtMsg.text, sGuid, txtReceiver.text) If (text <> "") Then MsgBox text End If Exit Sub ERR: MsgBox ERR.DescriptionEnd Sub
Note:
Calling the WCF Service is the same as calling the WebService Service!
If one RTX user wants to send instant messages to multiple RTX users, use; (semicolon) to separate the content in txtreceiver!
I hope this article will help students in need!
If you have any questions, contact me.
Qq/MSN: jonse_2010@hotmail.com