0

There is an application that was configured and has developed by JAX-WS; the piece of code like this:

@WebService(targetNamespace = "http://webservice.bulk.test.net/", serviceName = "BulkService")
@BindingType(value = SOAPBinding.SOAP12HTTP_BINDING)
@XmlSeeAlso({
        ObjectFactory.class
})
public class Bulk {

    @WebMethod
    @RequestWrapper(localName = "getProvinces", targetNamespace = "http://webservice.bulk.test.net/", className = "test.GetProvinces")
    @ResponseWrapper(localName = "getProvincesResponse", targetNamespace = "http://webservice.bulk.test.net/", className = "test.GetProvincesResponse")
    @Action(input = "http://webservice.bulk.test.net/Bulk/getProvincesRequest", output = "http://webservice.bulk.test.net/Bulk/getProvincesResponse")
    public void getProvinces(
            @WebParam(name = "username", targetNamespace = "") @XmlElement(nillable = false, required = true)
                    String username,
            @WebParam(name = "password", targetNamespace = "") @XmlElement(nillable = false, required = true)
                    String password,
...) {
}

According to this webservice, so many clients(jax-ws clients) are using.

I want to change the jax-ws to jax-rs without changing the client, another hand, the clients have no sens about the changes and do api-call as before.

Is it possible?

reza ramezani matin
  • 1,384
  • 2
  • 18
  • 41

1 Answers1

0

I solved this problem by separating soap layer from the application because of some reasons, first, used Jax-rs and Jax-ws endpoints simultaneously and secondly, is technical debt; due to separating soap from application, it is able to migrate to JDK-11 without any problems and thirdly, according to separating Soap from application, it is independent from JAX-WS clients except changing JAX-WS endpoints.

reza ramezani matin
  • 1,384
  • 2
  • 18
  • 41
  • That is essentially what my last comment said. Your "v1" endpoint is jax-ws, and your "v2" endpoint is jax-rs. (And of course you >STILL< need to replace the old clients in order to remove the technical debt ... of supporting a redundant endpoint.) – Stephen C Oct 16 '22 at 06:29
  • Yes of course but redundant api is not my concern. by separating, all technical debt such as jdk migration and others are solved. – reza ramezani matin Oct 16 '22 at 09:18
  • Shrug ... semantics. Technical debt it technical debt, whether or not you acknowledge it. By saying you have removed "all technical debt" you are basically kidding yourself. And you are potentially misleading other readers of your answer. – Stephen C Oct 16 '22 at 09:43
  • No, I mean except soap, the first I resolve others and the next I am going to resolve jax-ws porblem. – reza ramezani matin Oct 16 '22 at 10:14