0

I need your advice regarding exposing data from a web application A to be consumed by a web application B, both applications being ASP.NET WebForms application.

First thought I have in mind is to build a REST WCF webservice within web application A.

Is this the best option? What other options do I have with .NET 4.0? Is Web API a better alternative? If yes, why?

Later edit: I want to have call a method that receives 2 parameters and returns a class with 2 properties. In the future, I might need to add some similar methods.

Later edit 2: The input parameters are sensitive, it there a way to send it someway so nobody can see them using a http proxy tool.

user3104183
  • 408
  • 1
  • 9
  • 26
  • what do you want to do exactly? give some example for 'exposing' and 'consuming' maybe you're looking for a simple web service? – Visionstar Feb 09 '14 at 16:05
  • @Visionstar: I've updated the initial post. Did I answer to your question? – user3104183 Feb 09 '14 at 16:09
  • If the data **is sensitive** then you have 2 options: server-side (client side has no access/visibility) or encryption if client is involved in any way. Depending on what you mean by "sensitive", _signing_ (instead of encrypting) is also an option. – EdSF Feb 09 '14 at 18:10

1 Answers1

1

How about trying to implement a Webservice/webmethod?

I didnt exactly understand the purpose of transfering that data, but you can implement a webservice which passes a json-string

here is a example/tutorial of implementing web-methods:http://www.tutorialspoint.com/asp.net/asp.net_web_services.htm

also check out those two links: WebMethod return values in JSON format How do I make my aspx web method return the list as a JSON object?

Community
  • 1
  • 1
Visionstar
  • 355
  • 2
  • 12
  • Thanks for your response. As far I know, for a webservice, you need to have a proxy, or in other words, the application B should know implementation details about application A. Am I wrong? – user3104183 Feb 09 '14 at 16:19
  • You just have to know, that there is the webservice, which you can access via URL, that's all you need. If you want 2 different Applications to communicate with each other, then you will need something like this. – Visionstar Feb 09 '14 at 16:23
  • I see in your sample that a proxy should be created before consuming that web method... – user3104183 Feb 09 '14 at 16:30
  • Try this one: http://www.c-sharpcorner.com/UploadFile/1d42da/web-service-basics/ I think that is what you need – Visionstar Feb 09 '14 at 16:35