Skip to content

Instantly share code, notes, and snippets.

@nurettin
Forked from simonharrer/gist:1173228
Last active December 11, 2015 05:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nurettin/4556509 to your computer and use it in GitHub Desktop.
Save nurettin/4556509 to your computer and use it in GitHub Desktop.
awesome jax-ws Soap1.2 web service running on jruby 1.7.2
require 'java'
require 'jruby/core_ext'
class MyService
def hello(who)
"Hello #{who}"
end
end
MyService.add_class_annotations(
javax.jws.WebService => { "targetNamespace" => "http://www.maltepe.edu.tr/testjrubyjaxws/" },
# Soap 1.2
javax.xml.ws.BindingType => { "value"=> "http://java.sun.com/xml/ns/jaxws/2003/05/soap/bindings/HTTP/" }
)
MyService.add_method_signature("hello", [java.lang.String, java.lang.String])
MyService.become_java!
puts "publishing endpoint"
Endpoint = javax.xml.ws.Endpoint
Endpoint.publish( "http://localhost:8080/MyService/MyPort", MyService.new )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment