-
-
Save ramn/810991 to your computer and use it in GitHub Desktop.
Soap server in Scala
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
/* | |
CHANGELOG | |
- add annotation for param names | |
*/ | |
import javax.jws.{WebService, WebParam} | |
import javax.jws.soap.SOAPBinding | |
import SOAPBinding.Style | |
import javax.xml.ws.Endpoint | |
@WebService(targetNamespace="org.scalabound.test", name="org.scalabound.test", | |
portName="test", serviceName="WSTest") | |
private class MinimalSoapServer { | |
@SOAPBinding(style = Style.RPC) | |
def test( | |
@WebParam(name="username") uname: String, | |
@WebParam(name="age") age: Int | |
) = "Hi " + uname + ", your age is: " + age.toString | |
} | |
object MinimalSoapServer { // defined Companion Object for our class | |
def main(args: Array[String]) { // main method to make this a runnable application | |
val endpoint = Endpoint.publish("http://localhost:8080/wstest", new MinimalSoapServer()) | |
System.out.println("Waiting for requests...") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment