ASP.NET WebAPI + Soap

前端 未结 6 1435
陌清茗
陌清茗 2020-12-08 14:17

Does WebAPI support SOAP? I\'m trying to write a SOAP Server in MVC4 and whilst I can do it in WCF it seems that WebAPI is replacing this but I see no ways to utilize SOAP

6条回答
  •  囚心锁ツ
    2020-12-08 14:46

    WebApi does not support SOAP out of the box, indeed. But it is a quite flexible framework and you could "adapt" it to handle SOAP: nothing prevents you from manually parsing the received SOAP messages (they are plain XML after all) and manually generating the responses as XML strings, then sending them with the approproate content-type header (you could even write your own content formatter for this).

    Depending on your needs and your existing codebase, this may be worth the effort or you may want to use a more SOAP-firendly technology such as WCF or the already mentioned ServiceStack framework.

提交回复
热议问题