Home > Net >  Or WCF service problem, thank you.
Or WCF service problem, thank you.

Time:10-12

 
Host1=New ServiceHost (GetType (Rh_server. Login), the New Uri (" net. TCP://127.0.0.1:10000/"))
Host1. Description. Behaviors. The Add (New ServiceMetadataBehavior ())
Host1. AddServiceEndpoint (GetType (IMetadataExchange), MetadataExchangeBindings. CreateMexTcpBinding (), "A")
Host1. AddServiceEndpoint (GetType (Rh_server Ilogin), New NetTcpBinding (), the New Uri (" net. TCP://127.0.0.1:10000/login "))

Host2=New ServiceHost (GetType (Rh_server. A), the New Uri (" net. TCP://127.0.0.1:10000/"))
Host2. Description. Behaviors. The Add (New ServiceMetadataBehavior ())
Host2. AddServiceEndpoint (GetType (IMetadataExchange), MetadataExchangeBindings. CreateMexTcpBinding (), "B")
Host2. AddServiceEndpoint (GetType (Rh_server. Ia), New NetTcpBinding (), the New Uri (" net. TCP://127.0.0.1:10000/a "))

Host1. The Open ()
Host2. The Open ()

Make a winfrm as the host, the Tcp Wcf service, preparation is used to verify user name and the database access password,
As if he had succeeded, this service is, each corresponding to a file, all want to build a ServiceHost relate to?
These classes and properties all don't understand what you mean,

CodePudding user response:

ServiceHost only need one, you need multiple contract interface

CodePudding user response:

reference 1 floor XBodhi. Response:
ServiceHost only need one, you need multiple contract interface

Meaning, is to do all in one file??
Problem is all put together, if the interface is very much to do,

CodePudding user response:

That you can do a few more services,

CodePudding user response:

Host1. AddServiceEndpoint (GetType (IMetadataExchange), MetadataExchangeBindings. CreateMexTcpBinding (), "A")
What this mean, please, don't not line?

CodePudding user response:

The
reference 3 floor XBodhi. Response:
that you can do a few more service,

Moderator for help, the code on the same machine running without problems,
The WCF service running on a remote server, the client specified server IP, can not find the specified services, how to do?

CodePudding user response:

PORT to open different, because you can't open multiple services use a PORT, please check,

CodePudding user response:

reference 6 floor XBodhi. Response:
PORT to open different, because you can't open multiple services use a PORT, please check,

Find the reason, successful, change the 127.0.0.1 localhost,

CodePudding user response:

Behind this don't use what WCF, consider others with your butt? For example, python, Java, although you can tell them that WCF is a webserice nature, you can use this way to play, but somebody else still a face of meng force,

CodePudding user response:

refer to the eighth floor wanghui0380 response:
this don't use what the WCF, consider behind others with your butt? For example, python, Java, although you can tell them that WCF is a webserice nature, you can use this way to play, but somebody else still a face of meng,

I mainly for C/S and B/S not how, can't,
I make WCF, is only going to verify user information, and then encrypted database connection character,
The original features of C/S mode, write the database connection characters in it, I always don't trust, afraid of others the disassembly,

CodePudding user response:

If HTTP is recommended that you use ASMX or WEBAPI, duplex communication recommend you use WCF or write their own SOCKET, WCF is based on the contract, if the contract design is reasonable, is very good, is the configuration is more complex,
  • Related