How to open EJB as a web service that will later allow me to maintain client compatibility when ejb changes?

A lot of frameworks allowed me to expose ejb as a web service.

But 2 months after the publication of the initial service, I need to change ejb or any part of its interface. I still have clients who need to access the old interface, so I obviously need to have 2 web services with different signatures.

Does anyone have any suggestions on how I can do this, preferably if the environment does the job of creating wrappers and copy logic (unless there was a more sensible way).

I can choose a webservice structure based on this, so suggestions are welcome.

Edit: I know that my change will break compatibility, and I fully understand that I will need two services with different namespaces at the same time. But how can I do this in a simple way?

+3
source share
3 answers

I do not think you need an additional framework for this. Java EE allows you to directly open EJB as a web service (since EJB 2.1 , see for J2EE 1.4 ), but with EE 5 it is even simpler:

@WebService
@SOAPBinding(style = Style.RPC)
public interface ILegacyService extends IOtherLegacyService {
    // the interface methods
    ...
}

@Stateless
@Local(ILegacyService.class)
@WebService(endpointInterface = "...ILegacyService", ...)
public class LegacyServiceImpl implements ILegacyService {
    // implementation of ILegacyService
}

ILegacyService , . jezell, , . , . LegacyServiceImpl.

+5

EBJ, , -. (, , ), , .

, - . , :

http://myservice.com/2006

:

http://myservice.com/2009

.

, . , . , , . .

PS: , , .

0

OK, here it goes;

dozer.sourceforge.net seems to be an acceptable starting point for performing a data copy operation between two parallel structures. I believe that many web frameworks can create client proxies that can be reused in the server context for compatibility.

0
source

Source: https://habr.com/ru/post/1698519/


All Articles