Skip to content

Instantly share code, notes, and snippets.

@ramn
Forked from kings13y/MinimalSoapServer.scala
Created February 4, 2011 11:06
Show Gist options
  • Save ramn/810991 to your computer and use it in GitHub Desktop.
Save ramn/810991 to your computer and use it in GitHub Desktop.
Soap server in Scala
/*
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