.net - WCF WebService Replication -


I would like to repeat the web-service given for simulation purposes. The main idea is that the new The service applies the same interface as the existing one (which I do not control in any way) but with different actual method implementations Again, I would like to be able to redirect the request to a real address or in a test situation without simulating one without changing the configuration. Is this possible in WCF? In the case of actually copying service, if the existing service is exposed, then metadata, i.e., the WSDL , You can essentially recreate the service as follows:

  1. Browse wsdl and save all xsd wsdl references and all them on disk
  2. With those files, to run the wsdl.exe utility, make it to wsdl and xsd and use the / si option to create a service interface.
  3. The output will be an interface file (c # file)
  4. Visit Visual Studio and create a new project of "WCF Service Application"
  5. Initial Service Rename 1 (and interface) files and sections to your new service name and interface.
  6. Copy and paste the above interface code into the new service's interface class file
  7. In the service category, apply the service method to whatever you want to apply. (TIP: If you right click on the interface name in the file, you can use the "Implementation Interface" option so that VS can exclude it for you - good feature.)
  8. Make it and you should be ready to go.

    In the case of toggling between the original and your new service, I think that an option is from the client side reference which is the code (vs. config) the way you use a service or other Toggle a switch to hit ...

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

ruby on rails - Convert a Activerecord result with has_one associations into a single hash per record -

javascript - Read complete data from stream from onMessage -