Friday 15 August 2014

c# - Adding a custom constructor in a WCF service and access it on the client (asp.net or windows forms) -


I have to give a string as a parameter for the WCF service through a custom constructor.

  Public Partial Class ServiceXX: IServiceXX {Private String Test; Fixed service () {} public service X () {this.test = null; } Public Service (string test) {this.test = test; }}   

The client should be able to use this constructor with parameters through service reference (proxy).

ASP.x Example:

  (ServiceXXClient proxy = New service XXX client ("test")) {}   

Also suggest?

Thanks in advance.

You just can not do the service code in the client. It only cares about the endpoint (ABC - address, binding, contract). Remember that you are not calling the code, you are sending a message on the wire (or between processes) that will be received and translated to use your code.

  Customer - Friendly code call with call service (via    ) - Create message - serialise - Send service - Received message - Validate / Verify - deserialise - Certified / Authorized -

No comments:

Post a Comment