1

I have one ServiceStack application with one class named Performance in this application.

Now, I have another application which is used by my end user. This is a console application, downloaded by end user and run as a background task.

I want to POST the performance data from that application to my REST web service and store it in a database.

For that I need to run this in my client application, which posts the performance data to my ServieStack application in JSON format:

 JsonServiceClient client = new JsonServiceClient("http://localhost/RestIntro");
        var res = client.Post<Performance>("/Performance", c);

I don't have Performance class in my client application. I don't want the client to have the class so that I can update all clients if I need to make a change.

I want to know, how can I get the Performance class or its DLL in to my client application dynamically? So when the client runs it will have the class in order to make the post to the web service.

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
amit patel
  • 2,287
  • 8
  • 31
  • 45
  • 2
    -1 for "Please vote for this to gets higher priority." I don't actually think what you are talking about is "really tricky". All you would need is an updater app that loaded first, checked for updates, copied them to your application directory and exited. – satnhak Nov 04 '11 at 14:15
  • Hey, I think your really just thinking on a straight forward way for just updating app runs first, i know this solution, but i don't want this, as for updated, in my case I have to stop the running exe and replace with new one, which stops data for few seconds, and even creates a problem in case of network issue occur, I think "mythz" (see the below users profile) is getting my question, because he is a creator/developer of service stack application.(please check his profile) – amit patel Nov 05 '11 at 04:50

2 Answers2

1

I recommend that you keep the DTOs of your ServiceStack web services separate in a dependency-free project as this is what represents the contract or API of your services. If it's in its own assembly than you can easily share it with any of your clients or unit tests, etc.

If you don't like the idea of copying a dll around (even though its less work/friction), you can generate your own DTOs from the xsds on the /metadata page, see this question:

How can i convert XSD file to C# Class

Community
  • 1
  • 1
mythz
  • 141,670
  • 29
  • 246
  • 390
0

What you are talking about is actually available by using a SOAP service. Or, you need to create a "performance" class on the client and deserialize the JSON result to that class.

David Savage
  • 760
  • 5
  • 15