locked
MVC 4 e WCF (DataContracts x Model mvc) RRS feed

  • Question

  • User-665281982 posted

    I have an ASP.NET MVC 4. I also have a services layer, which I imagine to keep SOAP. I then DataContracts (models) ... I know the MVC also has a model. What better implementation? Can I use the model in mvc WCF, or need to create another similar model in mvc? Can you give me examples? thank you

    Saturday, June 8, 2013 7:44 AM

Answers

  • User220959680 posted

    mvc WCF

    There is no mvc WCF. Microsoft has released ASP.NET Web API as part of MVC 4 release to implement RESTFul web services.

    Can I use the model in mvc WCF, or need to create another similar model in mvc? Can you give me examples?

    Same model can be used in both ie., client application and the web services (ASP.NET Web API).

    Samples: http://www.asp.net/web-api/samples

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, June 8, 2013 4:12 PM
  • User260886948 posted

    Hi,

    I agree with the @sukumarraju, you can achieve it by using the asp.net web api.

    Here is a example which tell you step by step:

    #ASP.NET WEB API Basics (MVC 4):
    http://www.codeproject.com/Articles/588909/ASP-NET-WEB-API-Basics-MVC-4 .

    Here is a tutorial about the asp.net web api:
    http://www.asp.net/web-api .

    Hope it can help you.

    Best Regards,
    Amy Peng
     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, June 10, 2013 3:02 AM

All replies

  • User220959680 posted

    mvc WCF

    There is no mvc WCF. Microsoft has released ASP.NET Web API as part of MVC 4 release to implement RESTFul web services.

    Can I use the model in mvc WCF, or need to create another similar model in mvc? Can you give me examples?

    Same model can be used in both ie., client application and the web services (ASP.NET Web API).

    Samples: http://www.asp.net/web-api/samples

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, June 8, 2013 4:12 PM
  • User260886948 posted

    Hi,

    I agree with the @sukumarraju, you can achieve it by using the asp.net web api.

    Here is a example which tell you step by step:

    #ASP.NET WEB API Basics (MVC 4):
    http://www.codeproject.com/Articles/588909/ASP-NET-WEB-API-Basics-MVC-4 .

    Here is a tutorial about the asp.net web api:
    http://www.asp.net/web-api .

    Hope it can help you.

    Best Regards,
    Amy Peng
     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, June 10, 2013 3:02 AM
  • User-665281982 posted

    thanks for the answer..

    But i´m using SOAP services with MVC 4. Can i not reference the services in mvc 4 ?

    Tuesday, June 11, 2013 2:13 PM