-
-
Save tassioauad/1e7c8243911d6a50a1faa48dbc1b4230 to your computer and use it in GitHub Desktop.
Spring Boot + Apache CXF (JAX-WS)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.jws.WebMethod; | |
import javax.jws.WebParam; | |
import javax.jws.WebResult; | |
import javax.jws.WebService; | |
import javax.xml.ws.RequestWrapper; | |
import javax.xml.ws.ResponseWrapper; | |
import java.util.logging.Logger; | |
@WebService(serviceName = "HelloService", portName = "HelloPort", targetNamespace = "http://tassioauad.com/") | |
public class HelloPort { | |
private static final Logger LOG = Logger.getLogger(HelloPort.class.getName()); | |
@WebResult(name = "return", targetNamespace = "") | |
@RequestWrapper(localName = "sayHello", targetNamespace = "http://tassioauad.com/", className = "tassioauad.com.SayHello") | |
@WebMethod(action = "urn:SayHello") | |
@ResponseWrapper(localName = "sayHelloResponse", targetNamespace = "http://tassioauad.com/", className = "tassioauad.com.SayHelloResponse") | |
public java.lang.String sayHello(@WebParam(name = "myname", targetNamespace = "") String myname) { | |
try { | |
return "Hello, " + myname + "!"; | |
} catch (java.lang.Exception ex) { | |
ex.printStackTrace(); | |
throw new RuntimeException(ex); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment