Search code examples
asp.net-web-apiodata

Expose as OData API by relay the SOAP call?


Having a legacy on prem SOAP API, need to expose it to the vendor to call in, however, vendor preferred API in oData feed. Newbie in odata myself, not sure how would it work and if it at all possible. My thought is to write an API tier translating the odata call to a SOAP call? thoughts?


Solution

  • This is a very similar question to here: Is it possible to query a soap endpoint via odata?

    Here is the answer I gave for that question:

    You could create an OData wrapper around a SOAP endpoint but I don't think that it is worth it.

    The OData service would allow filtering, ordering and selecting by all of the properties (amongst other things) and the SOAP service may not allow all of this so your OData service would probably have to go and get all of the data and then post process it which loses the main benefit of OData in that you can do all of the filtering and sorting on the server side. You may as well just get the data client side and filter it there.

    If your SOAP service somehow does have all of this support then yes, you could write an OData wrapper for it and get these benefits but it would still be a lot of work to convert all of the different possible queries into something that your SOAP service can handle.

    I don't know your reasons for wanting an OData wrapper but it seems like this might be a lot of work for minimal benefit but it all depends on your use case.

    I think that this is a very similar case here, writing an OData wrapper for this would be lot of work and wouldn't give many benefits. If you are using entity framework/web.api then it might not be too much work to do to write a new OData service to expose the functionality that they need and there are a lot of tutorials around (like this) that should help get you started but otherwise, it might be worth seeing whether they can consume your existing services or something similar!