I have got WCF Service which has several interfaces implemented. Interfaces inherit from the base interface.
public interface IServiceA : IBaseService
public interface IServiceB : IBaseService
In the process of publishing, is it possible to hide one or more interfaces and expose only one selected?
Related
I would like to know is it possible to generate internal service contract classes and public data contract classes for a wcf service using svcutil commandline?
svcutil can be used to extract the public data contract classes that are used in the methods that are exposed by the service.
See: https://msdn.microsoft.com/en-us/library/aa702581(v=vs.110).aspx
If you need to extract classes that are only used internally in the service you could use a decompiler such as jetbrains dotpeek.
The client connects to a server and then can request it AND the server can invoke some commands on the clients as well.
Is there anything like this in Java?
In my opinion there is no such thing called duplex webservices, To achieve Client-Server relationship in both direction (duplex as you termed it), You can expose webservice interface at both the ends for consuming.
Both webservices component acts as Client and Server simultaneously, by exposing consumable web service interface for each other.
See below image for better clarity.
How do you mock old web services (not WCF) with Rhino Mocks, I can find plenty on WCf but not the old ones?
To mock a Web Service, you have to extract an interface from the generated web service code (reference.cs), and make the web service code inherit from that interface. You could make the web service "reference.cs" implement the interface, but may kill that code when you "update web reference". The trick is to add a second "partial class" that will inherit from that interface.
Then you mock the interface, Gah, why didn't i think of this earlier
Is there any existing way to consume web services (SOAP, JSON, etc.) leveraging dynamic keyword from C# 4.0?
I'm looking for as lightweight implementation as possible (without calling wsdl.exe or such).
You can just share the contract (the interface) between the client and server. Then the ChannelFactory class will allow you to create communication channels to the server based on either pure code or a configuration file (app or web.config).
In most cases we are using ASP.NET web services (System.Web.Script.Services.ScriptService) in our AJAX based web applications. This approach brings a major advantage providing automatically all the server-side classes (used in the web service methods) on client side in form of JavaScript alternatives (JavaScript classes with appropriate namespace).
However, in our applications we are working with classes based on a 3rd party framework. These classes inherit many unserializable properties that makes them unusable for the automatic web service serialization into JSON and back once sent to the client side.
Is there a way to define the list of properties to serialize to JSON and back (once send to client and back) for appropriate class?
There are two approaches I can think of:
Wrap your 3rd party classes in your
own classes where you can control
what properties get exposed to the
serializer. This has the benefit
that it should allow you to expose
the data with any web service
implementation (e.g. JSON, XML).
Create a JavaScriptConverter
class that will let you implement
custom serialization and
deserialization of the third party
classes.