0

i have a requirement to convert different kinds of services like soap based services, wcf xml services,web services that is currently running in silverlight app. so conversion we have use angular as front end and server side currently don't do a modification.

In this case, question have is

is it possible to consume different structures of xml services like soap, asmx ,web services in angular directly. or need to deserialize in angular.

Note : currently we don't modify existing services responses,because the client already using existing app.for time consumption,have only change the business logic in angular.

Or else we need to write any webapi or wrapper to consume the service and to convert to json and host it in server to consume json,

is there any other techniques ? suggestions are more appreciated

Mohamed Sahir
  • 2,482
  • 8
  • 40
  • 71
  • You just need to open a new endpoint for your WCF service and for that you don't have to update any code. Changes in your `web.config` to add additional `endpoint` should do the work. More reference: https://stackoverflow.com/q/2086666/1417185, https://www.codeproject.com/Questions/1185361/How-to-return-JSON-result-from-WCF-service – Paritosh Jan 07 '20 at 06:10
  • @paritosh anyway we need to create new end points?, without touching previous services or new endpoints ,is it possible to do in angular side . – Mohamed Sahir Jan 07 '20 at 06:13
  • 1
    It's doable, but not advised. Depending on the current endpoints configuration, you'll have to deal with A LOT of XML, SOAP, HTTP yourself. Looking at all the others who have gone before you (SOAPies & RESTafarians alike), I think the conclusion is: It's better, cheaper and in total less time consuming going JSON on the server than doing all the XML stuff on the client (no native support for SOAP is really painful). You'll need a RESTful service(s) talking in JSON with easy clientside usage or stick with XML,SOAP and prepare to endure the XML API and have fun with SOAP headers/encoding. – Marvin Smit Jan 07 '20 at 09:55

1 Answers1

0

Ideally, this should be handle at the server - by simply adding a new endpoint should do the work.

However, if your ask is not to change anything on server, below are the npm packages you can utilize.

  1. node-xml2js
  2. ngx-xml2json

More reference:

  1. Angular2: Convert XML to JSON
  2. Angular: Convert XML to JSON
Paritosh
  • 11,144
  • 5
  • 56
  • 74