Create client projects respectivelyRotestclient, Server projectRotestserver
The paths areRotest \ ClientAndRotest \ Server
Start from the server and useServicebuilderServer Creation Method
Create a new service
NameTestservice, Click"Add operation"Create a New Method
Create a new method"Appendstring", IncludingA, BTwo string parameters. The return value is a string.String
Close the dialog box and save itRotest \ ServerDirectory,Name the file"Testservice"
ToRotestserverProject Add Server definition file, right-click, add, existing item
Select "all files" and select"Testservice. rodl"
After adding, only includeRodlFile
Double-clickRodlFile, and close it to generate an interface file
GenerateRotestserverThe prompt is displayed because the interface method is not implemented.
Locate the error location to implement this method
Open ServerForm1Form, drag inIPtcpserverchannelAndBinmessageWidget
ToIptcpserverchannel1AddDispatcher,MessageSelectBinmessage1
Iptcpserverchannel1OfActiveSet propertyTrue
After the server is configured, set the client
Open the clientForm1Form, drag inIPtcpclientchannelAndBinmessageWidget,And a buttonButton
Iptcpclientchannel1OfHostnameUsed for communication with the server.IPAnd settings (such as serverProgramIn192.168.0.100, Set192.168.0.100In this example, the default value isLocalhost
NextRotestclientProject import interface file, right-clickRotestclientProject, add, existing project, find
RotestserverDirectoryINTFFile, add as Link
On the button write to click events
private void button#click ( Object sender, eventargs E)
{
string append = cotestservice . create (binmessage1, iptcpclientchannel1 ). appendstring ( " hello, " , " world " );
MessageBox. Show (append );
}
So far, the client settings are complete.
Separate rotestserver.exeand rotestclient.exe
Click the client's button1 to return the result.
So far, a typical client/server program supported by remobjects has been completed.