Can we implement method overloading in web service class?

后端 未结 2 2152
遥遥无期
遥遥无期 2020-12-06 12:46

I would like to implement method overloading in the Java web service class as follows:

public String myMethod(User user)
{
    // My code
} 

public String m         


        
2条回答
  •  孤街浪徒
    2020-12-06 13:44

    Operation overloading is not allowed for web services.
    It is explicitely prohibited in WS-BP and WSDL 1.2 also disallows it.
    Even if you found a stack that has some support for this I would recommend not to follow this approach.
    Overloading is an OO concept. Don't try to apply them to Service Oriented paradigm

提交回复
热议问题