Skip to content

Instantly share code, notes, and snippets.

@kings13y
Created February 2, 2011 21:53
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save kings13y/808533 to your computer and use it in GitHub Desktop.
Minimal Soap Server using Scala and JDK6 annotations
import javax.jws.WebService
import javax.jws.soap.SOAPBinding
import javax.jws.soap.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(value : String) = "Hi " + value
}
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...")
}
}
@prayagupa
Copy link

@kings13y

The application doesn't run. It gives following error on style = Style.RPC

Exception in thread "main" com.sun.xml.internal.ws.model.RuntimeModelerException: SOAPBinding Style RPC for method test conflicts with global SOAPBinding Style DOCUMENT
    at com.sun.xml.internal.ws.model.RuntimeModeler.processMethod(RuntimeModeler.java:689)
    at com.sun.xml.internal.ws.model.RuntimeModeler.processClass(RuntimeModeler.java:475)
    at com.sun.xml.internal.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:305)
    at com.sun.xml.internal.ws.db.DatabindingImpl.<init>(DatabindingImpl.java:85)
    at com.sun.xml.internal.ws.db.DatabindingProviderImpl.create(DatabindingProviderImpl.java:59)
    at com.sun.xml.internal.ws.db.DatabindingProviderImpl.create(DatabindingProviderImpl.java:43)
    at
 ...

@kginon
Copy link

kginon commented Dec 20, 2015

Correct indeed,
i used Style.DOCUMENT instead of RPC and it worked
Still trying to understand the difference between them and how it will affect the wsdl which is created automatically

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment